[PD-dev] [ pure-data-Patches-1543850 ] $@ and $# expansion (argc, argv)

SourceForge.net noreply at sourceforge.net
Tue Jan 2 19:52:54 CET 2007


Patches item #1543850, was opened at 2006-08-21 12:24
Message generated for change (Comment added) made by zmoelnig
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=478072&aid=1543850&group_id=55736

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: puredata
Group: wishlist
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: IOhannes m zmölnig (zmoelnig)
Assigned to: Miller Puckette (millerpuckette)
Summary: $@ and $# expansion (argc, argv)

Initial Comment:
the attached patch extends the $-expansion mechanism:

$# expands to the number of arguments; usable both as
A_DOLLAR (just "$#") and A_DOLLSYM ("$#-bla")

$@ expands to the entire list of arguments (e.g. [$@
$@( will expand [1 2 3( to [1 2 3 1 2 3(); this is only
usable as A_DOLLAR; i.e. [symbol $@-a( will always
expand to "$@-a"

why:
well, its a way to deal with dynamic length lists that
is still missing in pd (though 1st steps have been made
with [list])


caveats:
what is still missing is an expansion for the selector
of messages and objects (the selector of an object
would be the object's instantation name); would $$ be a
good name for this? (since $0 is already taken)

----------------------------------------------------------------------

>Comment By: IOhannes m zmölnig (zmoelnig)
Date: 2007-01-02 19:52

Message:
Logged In: YES 
user_id=564396
Originator: YES

updated for current CVSversion of pd (2007-01-02)
File Added: dollargcargv.patch

----------------------------------------------------------------------

Comment By: Hans-Christoph Steiner (eighthave)
Date: 2006-08-23 00:21

Message:
Logged In: YES 
user_id=27104


Yes!  This is great!

As for the selector, $0 is not taken in message space, so I
think it makes sense there.  Since message expansion
variables are already different than object arguments, I
think that won't be too confusing.  Plus the $ variable
syntax comes from shell scripting, where $0 is basically the
selector of the message that is the command line arguments.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=478072&aid=1543850&group_id=55736




More information about the Pd-dev mailing list