From: Pau Garcia i Quiles Date: 2006-08-28T04:09:39+09:00 Subject: Re: Matz' Wild Ideas: Annotations --nextPart4473612.Vdnv58jMtv Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Sunday 27 August 2006 05:11, Trans wrote: > I was looking at Matz' Wild and Weird ideas [1]. He talks about > annotations at one point and gives this example: > > # @require: arg1 >=3D 10 > # @overriding: true > # @visibility: public > def foo(arg1) > ... > end > > I'm not too keen on using comments like this. It separates the > annotations from ordinary code, thwarting the great dynamic nature of > Ruby. Perhaps autovivify class level methods with a syntax like call > instance vars could be used instead: > > @foo require: lambda { arg1 >=3D 10 } > overriding: true, > visibility: public > > That way they could be used any where, even encapsulated and reused. > > T. > > [1] http://www.rubyist.net/~matz/slides/rc2005/index.html It would be really nice to implement something like Spark's annotations: http://en.wikipedia.org/wiki/SPARK_programming_language#Annotation_examples =2D-=20 Pau Garcia i Quiles http://www.elpauer.org (Due to the amount of work, I usually need 10 days to answer) --nextPart4473612.Vdnv58jMtv Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) iD8DBQBE8e3o/DzYv9iGJzsRAhftAJ4rWqk5rULSs9Lc/HCaaYik1D+O7gCgvkXw NtSpMrFnoseZE9L4XKdQjfw= =XBx3 -----END PGP SIGNATURE----- --nextPart4473612.Vdnv58jMtv--