Nicholas Van Weerdenburg
12/5/2004 3:49:00 AM
On Sun, 5 Dec 2004 01:47:29 +0900, Sam Stephenson <sstephenson@gmail.com> wrote:
> On Sun, 5 Dec 2004 01:14:57 +0900, Nicholas Van Weerdenburg
>
>
> <vanweerd@gmail.com> wrote:
> > Is there a way to get the name of the symbol passed to a method?
> >
> > e.g.
> >
> > def geterdone(array)
> > # funkify array- but I want to know name of original symbol, not
> > array, and prefix each element with it
> > newarray=array.select(...){...}
> > end
> >
> > oldarray=[val1, val2, ...]
> > newarray=geterdone(oldarray)
> > # newarray is now ["oldarray:val1", "oldarray:val2", ...]
> >
>
> Not without one of the parse-tree hook extensions, I would think. And
> even then, what would you expect to happen here?
> | newarray = geterdone([val1, val2, ...])
>
nil maybe.
Thanks,
Nick