From: "Yemi I. D. Bedu" Date: 2008-05-22T07:16:23+09:00 Subject: Re: lambda, ->, haskell, and so on This is a multi-part message in MIME format. ------_=_NextPart_001_01C8BB8E.8640E0DB Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello, Maybe there is the case that the def is being squeezed into being more meaningful for function definition than general definition. You have very good reasoning for consistency. Other people have good ideas for layout of code and if they come together would possibly work well. An example: =20 nameOfFunc =3D func (a, b) { a + b; } =20 def nameOfFunc; func(a, b) { a + b; }; end =20 def nameOfFunc(a, b); func { a + b; }; end =20 Oh, and while typing these, func felt more natural to my fingers than just fun. I think though that the f and n are the most important to include and fun or fnc or other choices add mostly only flare, favor, or resistance to settling the choice. Good day. Yemi Bedu P&R Fasteners 325 Pierce St Somerset, NJ 08873 732-302-3600=20 ________________________________ From: Nate_Wiger@playstation.sony.com [mailto:Nate_Wiger@playstation.sony.com]=20 Sent: Wednesday, May 21, 2008 2:53 PM To: ruby-core@ruby-lang.org Subject: Re: lambda, ->, haskell, and so on =20 Hi-=20 Yukihiro Matsumoto wrote on 05/19/2008 10:23:29 AM: > Hi, >=20 > In message "Re: lambda, ->, haskell, and so on" > on Tue, 20 May 2008 01:49:04 +0900, Nate_Wiger@playstation.sony. > com writes: >=20 > |Second, there are a couple alternatives that we could use, leveraging > |existing Ruby syntax:=20 > | > | 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 >=20 > So, you prefer lambda(x) {...} or x =3D> {...} over ->(x){...}, right? > The latter (=3D>) conflicts with other part of Ruby syntax, namely = hash > literals, besides it complicates the language. >=20 > I am not fond of "lambda" being keyword, because >=20 > * 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 is also Ara's suggestion of using "def" for this purpose:=20 =20 http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/16804=20 This would make Ruby more consistent with other languages:=20 Ruby=20 def name; "stuff"; end=20 name =3D def() "stuff"; end=20 =20 Perl 5=20 sub name { "stuff"; }=20 $name =3D sub { "stuff"; }=20 JavaScript=20 function name(){ "stuff"; }=20 name =3D function(){ "stuff"; } =20 (Perl 6 is not really worth considering, since there's not much evidence it will actually ship.)=20 > There could be a chance for the keyword like "fun" or "fn", but > there's little hope. Hopefully a solution can be found that the core team is happy with. Personally,=20 I have seen many people in opposition to the use of "->" to mean lambda in=20 this context. I think a better alternative can be found.=20 Thanks for your consideration.=20 Nate Wiger=20 PlayStation=20 ------_=_NextPart_001_01C8BB8E.8640E0DB Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hello,

 Maybe there is the case that = the def is being squeezed into being more meaningful for function definition = than general definition. You have very good reasoning for consistency. Other = people have good ideas for layout of code and if they come together would = possibly work well. An example:

 

nameOfFunc =3D func (a, b) { a + b; = }

 

def nameOfFunc; func(a, b) { a + b; = }; end

 

def nameOfFunc(a, b); func { a + b; = }; end

 

Oh, and while typing these, func = felt more natural to my fingers than just fun. I think though that the f and n are = the most important to include and fun or fnc or other choices add mostly = only flare, favor, or resistance to settling the choice. Good = day.

Yemi Bedu

P&R Fasteners
325 Pierce = St
Somerset, = NJ 08873
732-302-3600
=


From: Nate_Wiger@playstation.sony.com [mailto:Nate_Wiger@playstation.sony.com] =
Sent: Wednesday, May 21, = 2008 2:53 PM
To: ruby-core@ruby-lang.org
Subject: Re: lambda, = ->, haskell, and so on

 


Hi-

Yukihiro Matsumoto <matz@ruby-lang.org> wrote on 05/19/2008 10:23:29 = AM:
> Hi,
>
> In message "Re: lambda, ->, = haskell, and so on"
>     on Tue, 20 May 2008 = 01:49:04 +0900, Nate_Wiger@playstation.sony.
> com writes:
>
> |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 = =3D> {...} over ->(x){...}, right?
> The latter (=3D>) 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 is also Ara's suggestion of using "def" for this = purpose:

        http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/16804<= /font>

This would make Ruby more consistent with other languages:

   Ruby
      def name; "stuff"; end
      name =3D def() "stuff"; end =
 
   Perl 5
      sub name { "stuff"; }
      $name =3D sub { "stuff"; } =

   JavaScript
      function name(){ "stuff"; } =
      name =3D function(){ "stuff"; }   =  

(Perl 6 is not really worth considering, since there's not much = evidence
it will actually ship.)

> There could be a chance for the keyword like "fun" or = "fn", but
> there's little hope.

Hopefully a solution can be found that the core team is happy with. = Personally,
I have seen many people in opposition to the use of "->" to mean lambda = in
this context.  I think a better alternative can be = found.

Thanks for your consideration.

Nate Wiger
PlayStation

------_=_NextPart_001_01C8BB8E.8640E0DB--