From: Uwe Kubosch Date: 2008-11-06T17:41:52+09:00 Subject: Re: Constructors --=-RXVF7gdk6lOy03D9cOJf 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: >=20 > > I think the closest you can get to the Java syntax is this: > >=20 > > def new o, *args > > o.class =3D=3D Class ? o.new(*args) : o > > end >=20 > 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. --=20 With kind regards, Uwe Kubosch Kubosch Consulting Norway --=-RXVF7gdk6lOy03D9cOJf 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 =Rkqb -----END PGP SIGNATURE----- --=-RXVF7gdk6lOy03D9cOJf--