From: Mike Austin Date: 2005-08-07T10:41:10+09:00 Subject: Re: new block notation (was: Re: ruby-dev summary 26468-26661) gabriele renzi wrote: > Florian Gro� ha scritto: > >> >> def might not totally fit (it doesn't bind anything to a name), but it >> might still be the best choice if no new semi-keywords should be >> introduced. There's also undef, of course, but that is a more evil >> choice. :) > > > maybe with should go the Oz route, which provide a > make-named-thing-unnamed special symbol (but I think the real concept is > "make a statement an expression) > i.e. > > def foo(x,y) #defines a method foo > end > > foo= def $(x,y) .. end #defines an unnamed method and assigns to foo > > but again, creeping punctuation. > I'm on the 'fun' side :) If def returned the actual function, the 'anonymous' functionality would fit right in. Refactoring, we have: f = def foo(x,y) # 1 end f = def (x,y) # 2 end f = def(x,y) {} # 3 Mike