From: Nicholas Van Weerdenburg Date: 2004-12-05T12:48:37+09:00 Subject: Re: Is there a way to get the name of symbol passed to method? On Sun, 5 Dec 2004 01:47:29 +0900, Sam Stephenson wrote: > On Sun, 5 Dec 2004 01:14:57 +0900, Nicholas Van Weerdenburg > > > 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