From: "Mariusz Pękala" Date: 2007-06-02T00:03:25+09:00 Subject: Re: Introducing the "it" keyword --BRE3mIcgqKzpedwo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2007-06-01 22:52:31 +0900 (Fri, Jun), Brian Candler wrote: > On Fri, Jun 01, 2007 at 10:45:33PM +0900, Jacob Burkhart wrote: > > The point of enabling something like with:a(v+1){ ... } in addition to > > with(v+1){ |a| ...} is simply a proposal in answer to the original > > proposition about 'it': > > return it if |v+1| < 10 > >=20 > > something like: > >=20 > > return it if with:it(v+1) < 10 > >=20 > > return a if with:a(v+1) < 10 > >=20 > > return a,b if ( with:a(v+1) + with:b(x*y) ) < 10 >=20 > But if you're going to label them anyway, then why not write >=20 > return a,b if ((a =3D v+1) + (b =3D x*y)) < 10 The whole discussion started because this code does not work in current ruby parser rules. In the part 'return a,b' "a" and "b" are treated as method calls, but in 'if ((a =3D v+1) + (b =3D x*y)) < 10' they are treated as local variable= s. If you try to execute this line (use irb) you will get error 'NameError: undefined local variable or method `a' for main:Object' --=20 No virus found in this outgoing message. Checked by 'grep -i virus $MESSAGE' Trust me. --BRE3mIcgqKzpedwo Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7-ecc0.1.6 (GNU/Linux) iD8DBQFGYDUusnU0scoWZKARAsClAKC7uSyBClAEkz8ipj7qSHDtJWMtwwCgqaV9 dYe2rSG0eSMA7Q3N5rpeQts= =SMxC -----END PGP SIGNATURE----- --BRE3mIcgqKzpedwo--