[PD] optional argument in abstraction

João Miguel Pais jmmmpais at googlemail.com
Mon Feb 4 02:17:20 CET 2008


here's a dirty one, but works.


> hi,
> I want to create an abstraction that can take an optional symbol as
> argument.
> if there is a symbol argument then use this, if not then use a default
> symbol.
>
> for example
> [my_print hello_world!]
> would print "hello_world!"
>
> [my_print]
> (without argument) would print "default_text"
>
> [my_print 0] or [my_print 123] would also print "default_text".
>
> I tried all variations of route, select, list trim, but could not get it
> to work. maybe I forgot something. or maybe there is another trick. I am
> using 0.40.
> marius.
>
> _______________________________________________
> PD-list at iem.at mailing list
> UNSUBSCRIBE and account-management ->  
> http://lists.puredata.info/listinfo/pd-list



-- 
Friedenstr. 58
10249 Berlin
Deutschland
Tel +49 30 42020091
Mob +49 162 6843570
jmmmpais at googlemail.com
skype: jmmmpjmmmp
http://www.puredata.org/Members/jmmmp
IBM Thinkpad R51, XP, Pd-Ext-0.39-2-t5, Pd Van 0.40-t2
-------------- next part --------------
A non-text attachment was scrubbed...
Name: my_print.pd
Type: application/octet-stream
Size: 503 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20080204/0b7b8cc0/attachment.obj>


More information about the Pd-list mailing list