-- XVF7gdk6lOy03D9cOJf Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Tue, 2008-11-04 at 02:48 +0900, Robert Klemme wrote: > On 03.11.2008 17:11, Stefano Crocco wrote: > > > I think the closest you can get to the Java syntax is this: > > > > def new o, *args > > o.class == Class ? o.new(*args) : o > > end > > Can someone please explain to me what we gain by doing this? I am frequently converting Java code to Ruby using cut & paste. At most the code needs about 10% changing to run, and the "new" operator is one of those changes. If I didn't have to do it, the first step of converting, getting it to run, will go much faster. I always convert completely to ruby conventions, but I appreciate being able to do it in small steps. If the new operator, and accessing class constants using Class.CONSTANT was available, step 1 would be smaller. I would only use this for development. -- With kind regards, Uwe Kubosch Kubosch Consulting Norway -- XVF7gdk6lOy03D9cOJf Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEABECAAYFAkkSoCUACgkQB7Wzm8i8xUvVjwCdHeY20cgUKB2wyq8KeKHYZYDr UQgAn2fMrRWFoVaDC2T3U+Fm2CQSBSS5 qb -----END PGP SIGNATURE----- -- XVF7gdk6lOy03D9cOJf--