From: Philipp Meier Date: 2002-07-31T18:12:22+09:00 Subject: Re: Ruby and Ocaml - my two favorite languages --rf72Gf+bfLC8kxKs Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 31, 2002 at 10:57:32AM +0900, MikkelFJ wrote: > class X > def initialize > @name =3D "rock" > end > def identify() > puts @name > end > def rename(s) > @name =3D s > end > end >=20 > Notice in the following that when no parentheses is used, the function is > not evaluated, its closure > becomes the value. This is not standard Ruby and a future Ruby syntax wou= ld > probably need to > invent something else. >=20 > a =3D new X > b =3D a.y Shouldn't this read "b=3Da.identify"? Just to be sure I understand this closure thingy right. > b() #=3D> rock > a.rename("flower") > b() #=3D> "flower" -billy. --=20 Meisterbohne S=F6flinger Stra=DFe 100 Tel: +49-731-399 499-0 eL=F6sungen 89077 Ulm Fax: +49-731-399 499-9 --rf72Gf+bfLC8kxKs Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE9R6oKfBriNoqItSYRAo0vAKCJ/kxq0W2uSvT11UUwyKCPgvW5hwCgkeqo B+WFeJR/vu/LVv6FUrJqZTY= =QLYF -----END PGP SIGNATURE----- --rf72Gf+bfLC8kxKs--