[PD-dev] [ pure-data-Patches-1405137 ] multiple $arg-expansion

IOhannes m zmoelnig zmoelnig at iem.at
Fri Jan 13 20:40:54 CET 2006


now that is most likely even cooler than the 
abstraction-classname-binding...

please do some testing...


mfg.asdr
IOhannes

SourceForge.net wrote:
> 
> Initial Comment:
> currently $args can only be at the beginning of a
> A_DOLLARSYM.
> 
> this patch allows to have multiple $args within 1
> A_DOLLARSYM.
> e.g. with "foo bar me" the symbol "$1-bla-$3/$2" will
> expand to "foo-bla-me/bar"
> 
> the patch only modifies binbuf_realizedollsym() in
> m_binbuf.c (and adds another non-exported helper
> function binbuf_expanddollsym())
> 
> the patch is straightforward, but probably i
> misunderstood the meaning of "tonew" and implemented it
> in a wrong way (so you should check that)
> 
> caveat: the A_DOLLARSYM still has to start with
> "$[0-9]". this is the way, pd determines whether a
> given symbol should be $-expanded or not. furthermore,
> the leading $ is usually stripped by pd.
> e.g. if you type [$1-bar-$2], the symbol "1-bar-$2" is
> stored as A_DOLLARSYM. this means that the beginning of
> the dollarsymbol always has to be expanded.
> furthermore,  [bar-$2] will _never_ be expanded (since
> pd thinks it is an ordinary symbol).
> 
> i didn't dare to change this behaviour since
> SETDOLLARSYM() and binbuf_realizedollsym() are exposed
> in m_pd.h and probably used in externals which would
> then break.
> however, whenever this might change,
> binbuf_expanddollsym() is prepared (just need to "#if 1")
> 




More information about the Pd-dev mailing list