Many options have been proposed over the years, my favorite thus far is [thiscanvas]<br><a href="http://lists.puredata.info/pipermail/pd-dev/2004-12/003430.html">http://lists.puredata.info/pipermail/pd-dev/2004-12/003430.html</a><br>
<br><br><div class="gmail_quote">On Wed, Dec 15, 2010 at 8:34 AM, Jonathan Wilkes <span dir="ltr">&lt;<a href="mailto:jancsika@yahoo.com">jancsika@yahoo.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font: inherit;" valign="top">What exactly would &quot;this&quot; (#4) look like in Pd?<br><br>-Jonathan<br><br>--- On <b>Wed, 12/15/10, brandon zeeb <i>&lt;<a href="mailto:zeeb.brandon@gmail.com" target="_blank">zeeb.brandon@gmail.com</a>&gt;</i></b> wrote:<br>
<blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: brandon zeeb &lt;<a href="mailto:zeeb.brandon@gmail.com" target="_blank">zeeb.brandon@gmail.com</a>&gt;<div class="im">
<br>Subject: Re: [PD] PD OOP?<br></div>To: &quot;PD List&quot; &lt;<a href="mailto:pd-list@iem.at" target="_blank">pd-list@iem.at</a>&gt;<br>Date: Wednesday, December 15, 2010, 1:51 PM<div><div></div><div class="h5"><br><br>
<div>In my experience with emulating OOP in Pd I&#39;ve had moderate success.  As a Java developer by day, I find myself attempting to recreate familiar patterns within Pd (ie: usually IoC and Flyweight in Pd).   Main problems with recreating OOP in Pd are the following:<br>

<ol><li>Everything is global</li><li>No control over abstraction (object) construction order and lifecycle</li><li>No introspection (although not required, very helpful, and don&#39;t tell me it&#39;s in some external, I don&#39;t care!)</li>

<li>No concept of &quot;this&quot;</li><li>No interfaces or abstract abstractions (to control inlet patterns)</li><li>Unfriendly and inconsistent type system (it is cumbersome in real use, although I get over this by using [list])</li>

<li>and on and on</li></ol>In most Pd patches, I see people using a few lookup tables again and again (ie: mtof).  As this is a complete waste of memory, one can attempt the Flyweight pattern.  However, doing so in Pd is a very dangerous game, as you will have NO idea which abstraction first created the table and thus have no control over retaining access to it.  In my library I&#39;ve dropped this approach in favor of something closer to IoC.<br>

<br>Basic IoC is very possible, and indeed very rewarding.  Very often I pass in other abstractions as object creation arguments.  The most simple example of this in my library is my [bypass~] abstraction used to dynamically enable and disable a given abstraction.  I use this EVERYWHERE to save CPU cycles in combination with another object to programmatically disable the sub-abstraction when the user selects a given value (ie: when the filter cutoff is at MAX with no resonance, disable the filter).<br>

<br>In use:<br><br>[bypass~ some_process~ 330 1 3 9]<br><br>Where [bypass~] expects it&#39;s 1st argument to be an abstraction and the next 10 to be arguments to that abstraction.  Every patch which uses [bypass]~ must have 1 signal inlet and 1 event inlet.  Unfortunately, this interface can&#39;t be programmatically enforced. [bypass~] passes it&#39;s 1st two inlets to the sub-abstraction, while the 3rd is used to control [bypass~]<br>

<br>I&#39;ve attached [bypass~] and it&#39;s dependencies, have fun!<br><br>~Brandon<br>
</div><br></div></div><div class="im">-----Inline Attachment Follows-----<br><br><div>_______________________________________________<br><a href="http://mc/compose?to=Pd-list@iem.at" target="_blank">Pd-list@iem.at</a> mailing list<br>
UNSUBSCRIBE and account-management -&gt; <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br></div></div></blockquote></td></tr></tbody></table><br>

      </blockquote></div><br><br clear="all"><br>-- <br><font style="font-family: garamond,serif;" size="2"><span style="color: rgb(102, 102, 102);">Brandon Zeeb</span><br style="color: rgb(192, 192, 192);"></font><br><br>