Hey All,
When taking integer arguments in an abstraction, it's nice sometimes to set a default if the argument is not set. For this you can do something like:
[$1] | [select 0] | / [45( / | / [f ]
Or maybe something even simpler.
I would like to do something similar for symbolic arguments. I.e. if an argument is supplied, use it, otherwise use some default or take some other action. Unfortunately there seems to be no way to detect an 'empty' symbol. Has anyone got any ideas?
Best rgds,
Chris.
chris@mccormick.cx http://mccormick.cx
On Apr 24, 2006, at 12:51 PM, Chris McCormick wrote:
Hey All,
When taking integer arguments in an abstraction, it's nice
sometimes to set a default if the argument is not set. For this you can do
something like:[$1] | [select 0] | / [45( / | / [f ]
Or maybe something even simpler.
I would like to do something similar for symbolic arguments. I.e. if an argument is supplied, use it, otherwise use some default or take some other action. Unfortunately there seems to be no way to detect an 'empty' symbol. Has anyone got any ideas?
You want [float_argument], [symbol_argument], and [any_argument], in
CVS: abstractions/purepd
This is how you test for a blank symbol:
| [loadbang] | | | [symbol] | | [select symbol] | |
.hc
Best rgds,
Chris.
chris@mccormick.cx http://mccormick.cx
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
"Information wants to be free." -Stewart Brand
hi chris
[list append $1] | [sel 0]
detects empty arguments and outputs floats _and_ symbols
regards eni
On Apr 24, 2006, at 3:49 PM, Hans-Christoph Steiner wrote:
On Apr 24, 2006, at 12:51 PM, Chris McCormick wrote:
Hey All,
When taking integer arguments in an abstraction, it's nice sometimes
to set a default if the argument is not set. For this you can do
something like:[$1] | [select 0] | / [45( / | / [f ]
Or maybe something even simpler.
I would like to do something similar for symbolic arguments. I.e. if an argument is supplied, use it, otherwise use some default or take some other action. Unfortunately there seems to be no way to detect an 'empty' symbol. Has anyone got any ideas?
You want [float_argument], [symbol_argument], and [any_argument], in
CVS: abstractions/purepdThis is how you test for a blank symbol:
| [loadbang] | | | [symbol] | | [select symbol] | |
.hc
Best rgds,
Chris.
chris@mccormick.cx http://mccormick.cx
PD-list@iem.at mailing list UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list
"Information wants to be free." -Stewart Brand
PD-list@iem.at mailing list UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list