From: Christopher Gill Date: 2008-05-20T02:37:49+09:00 Subject: Re: lambda, ->, haskell, and so on how about an uppercase lambda (instead of the usual lowercase one) composed of a forward slash, then a backward slash: /\ /\(x) {...} http://en.wikipedia.org/wiki/Lambda pros: looks more like a lambda to me (than "->") only 2 characters so easy to type cons: none! (*) *may not be accurate On Mon, May 19, 2008 at 1:23 PM, Yukihiro Matsumoto wrote: > Hi, > > In message "Re: lambda, ->, haskell, and so on" > on Tue, 20 May 2008 01:49:04 +0900, Nate_Wiger@playstation.sony.com writes: > > |First off, it already means something specific in well-established > |languages such as Perl5 and C/C++. On my team, I have C++ coders that dip > |into Ruby (and vice-versa), and I really don't want to deal with "->" > |confusion. Most other pieces of syntax are easy to overcome, but "->" is > |nearly as pervasive as "+". > > Point taken, although I am very optimistic about the human ability to > adopt languages. If one can handle both Spanish and English at the > same time (or even worse, Japanese and English for my case), I can > believe he can handle '->' without confusion, if it's prefix form > unlike C++. ;-) > > |Second, there are a couple alternatives that we could use, leveraging > |existing Ruby syntax: > | > | http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/16662 > | http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/16616 > > So, you prefer lambda(x) {...} or x => {...} over ->(x){...}, right? > The latter (=>) conflicts with other part of Ruby syntax, namely hash > literals, besides it complicates the language. > > I am not fond of "lambda" being keyword, because > > * it changes meaning of the valid syntax ("lambda(a){p a}" is valid > in 1.8 with different semantics). > * it's long (6 letters). considering the functional programming > trend in Ruby and other languages, we will see anonymous function > expression more often in the future. > > There could be a chance for the keyword like "fun" or "fn", but > there's little hope. > > matz. > > how abou