From: Paul Brannan Date: 2004-08-06T05:30:39+09:00 Subject: Re: Macros in Ruby On Fri, Aug 06, 2004 at 04:18:41AM +0900, David A. Black wrote: > which bugs me in some way involving levels of indirection that I can't > quite put my finger on.... The way I see it, & and unary * (and possibly in the future unary **) are related operators in the sense that they transform their argument to or from a particular representation. For example, *array transforms array into a list inline, so that an array can be turned into an argument list for use in passing to a method. However, *param in a method definition takes a list of arguments and transforms it into an array. Similarly, it has been proposed to have **hash turn hash into a list of named arguments, and **param in a method definition to be used to transform unused named arguments into a hash. A similar symmetry exists with the & operator; when called using &proc it turns a proc object into a block and when used in a method's paramter list it turns a passed block back into a proc object. Using &{ ... } as a shorthand for creating proc objects would break this symmetry. We do currently use * and ** for both the above uses and for multiplication/exponentiation, but with these operations it is the binary versions of the operator, not the unary one, so there is no break in symmetry. Paul