I
Iñaki Baz Castillo
Hi, using String#replace I can "simulate" a pointer (thanks to David A. for=
=20
the explanation):
a =3D "orignal a value"
b =3D a
b =3D "new value"
a
=3D> "original a value"
b
=3D> "new value"
This is obvious: after the new assigment of "b" it points to a different=20
object.
So I can use "replace":
a =3D "orignal a value"
b =3D a
b.replace "new value"
a
=3D> "new value"
b
=3D> "new value"
But Fixnum has not this method "replace", neither Float. Doesn't make sense=
=20
any primitive Ruby Class having this "replace" method instead of just one o=
f=20
them?
=2D-=20
I=C3=B1aki Baz Castillo
=20
the explanation):
a =3D "orignal a value"
b =3D a
b =3D "new value"
a
=3D> "original a value"
b
=3D> "new value"
This is obvious: after the new assigment of "b" it points to a different=20
object.
So I can use "replace":
a =3D "orignal a value"
b =3D a
b.replace "new value"
a
=3D> "new value"
b
=3D> "new value"
But Fixnum has not this method "replace", neither Float. Doesn't make sense=
=20
any primitive Ruby Class having this "replace" method instead of just one o=
f=20
them?
=2D-=20
I=C3=B1aki Baz Castillo