From: Nikolai Weibull Date: 2004-08-06T01:14:38+09:00 Subject: Re: Macros in Ruby * Gavin Sinclair [Aug 05, 2004 17:40]: > > perhaps a shorthand: > > lambda{ puts 'lambda' } => Proc:0xb74041a0 > > &{ puts 'lambda too' } => Proc:0xb74041a1 > If you must have a shortcut, I think 'L' makes more sense. > L { puts 'lambda' } => Proc:0xb74041a0 Or \ { puts 'lambda' } => Proc:0xb74041a0 which would make it act sort of like it does in Haskell. However, I always figured proc{ puts 'proc or lambda' } or lambda{ puts 'proc or lambda' } was easy enough to understand. Having a special operator for it seems utterly redundant, as Gavin says, since creating anonymous functions in this manner is far from as common as in Haskell (and it's not very common their either). And given that Scheme or Lisp that use them for basically everything don't have a shorter notation (except for (define) "rewriting") than (lambda) doesn't seem to warrant a shorter notation for use in Ruby, nikolai -- ::: name: Nikolai Weibull :: aliases: pcp / lone-star / aka ::: ::: born: Chicago, IL USA :: loc atm: Gothenburg, Sweden ::: ::: page: www.pcppopper.org :: fun atm: gf,lps,ruby,lisp,war3 ::: main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}