a = Dog.new # a is not a pointer and not a reference?

  • Thread starter SpringFlowers AutumnMoon
  • Start date
I

Ian Whitlock

SpringFlowers said:
Doesn't a Ruby variable behave the same way in Java, PHP5, C++, and
Python?

No. Well, yes, to the extent that variables in all these languages
allow
the values of variables to vary, but that is too simple a view to be
useful beyond an introduction to programming.
As long as I view Ruby as a pointer to an object, everything clicks.

Well it it works for you fine, but for many it has problems. Languages
which have variables called pointers have values which are addresses and
some way to reference the object at the address value. In other words,
the concept of pointer carries with it the baggage that there will be
two ways to "evaluate" the variable - as an address or as an object.

Ruby variables cannot be evaluated to addresses, hence it is rather
misleading to most people to use the term pointer for a Ruby variable.
For example, in any language with pointer, p, it is reasonable to ask
in that programming language, what is the address obtained from p by
adding 8 bytes. There is no way to write this in Ruby.

So if you find it helpful and wish to say that some of the purpose of
variables in Ruby is served by some of the functions of some pointers
in languages with pointers, I doubt if any rubist would disagree. But
if you say Ruby variables are pointers in other languages, they are
likely to reply,"Rubbish", because Ruby does not want to require the
low level bookkeeping that pointers imply.

Ian Whitlock
 
S

SpringFlowers AutumnMoon

Ian said:
So if you find it helpful and wish to say that some of the purpose of
variables in Ruby is served by some of the functions of some pointers
in languages with pointers, I doubt if any rubist would disagree. But
if you say Ruby variables are pointers in other languages, they are
likely to reply,"Rubbish", because Ruby does not want to require the
low level bookkeeping that pointers imply.

I want to think of it like as a pointer to distinguish it from the C++'s
reference, which is quite different.

Maybe if C++ didn't call that reference but called it alias, then the
word reference wouldn't lead to some people thinking of it as C++'s
reference.
 
M

Morton Goldberg

hm,... but is there a problem to think of reference in Ruby as a
"pointer"? will that cause any trouble? I only see that
a.value is
not the same as C and C++ would use a->value, but in Ruby we use
the "."
to replace the "->" and that's it. Will there be further trouble or
discrepancy to think of Ruby reference as a pointer?

Well, your assertion that a.value is the equivalent of a->value is a
good example of getting into trouble by equating a reference to a
pointer. The expression a.value is a method call, not a value fetch.
For a.value to work, the object referred by a has have a method
called 'value', either an instance method or singleton method, in its
extended object table. If it does, the method is executed and some
object is returned. That's not at all what a->value does in C.

Regards, Morton
 
S

SpringFlowers AutumnMoon

Morton said:
Well, your assertion that a.value is the equivalent of a->value is a
good example of getting into trouble by equating a reference to a
pointer. The expression a.value is a method call, not a value fetch.
For a.value to work, the object referred by a has have a method
called 'value', either an instance method or singleton method, in its
extended object table. If it does, the method is executed and some
object is returned. That's not at all what a->value does in C.

how about just a.set_value(3) vs a->set_value(3). what i mean is just
the "." and "->" difference. using a "." in Ruby and "->" in C or C++.
If I think of "a" as a pointer and "." as "->", will that get in trouble
and have any discrepancy for other things.
 
R

Robert Dober

how about just a.set_value(3) vs a->set_value(3). what i mean is just
the "." and "->" difference. using a "." in Ruby and "->" in C or C++.
If I think of "a" as a pointer and "." as "->", will that get in trouble
and have any discrepancy for other things.
Yup 'cause '.' is not dereferencing period (pun intended). It is
sending a message

x.a is almost equivalent to
x.send :a.

Variables in Ruby are references, period again ;) but you cannot
dereference them.
I guess this was somehow lost in the discussion.

HTH
R.
 
M

Michael T. Richter

--=-hdpctJdvUY+0kkc8aGky
Content-Type: multipart/related; type="multipart/alternative";
boundary="=-srr5oxcmqaEO3Thlj6tF"


--=-srr5oxcmqaEO3Thlj6tF
Content-Type: multipart/alternative; boundary="=-nPsvEtWUnAArLeQb7kdQ"


--=-nPsvEtWUnAArLeQb7kdQ
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

[*] Betrand Meyer of Eiffel fame has often made fun of C++'s =20
reference semantics. He has claimed they are beyond the understanding =20
of mere mortals. He is joking, of course.



I spoke with Dr. Meyer during his trip to China last year. One of the
things we touched upon (naturally) was programming language design. He
is not joking when he talks about C++'s reference semantics. Not in the
slightest. Don't mistake his general good cheer and good nature for not
vociferously hating that language. ;)

--=20
Michael T. Richter <[email protected]> (GoogleTalk:
(e-mail address removed))
Never, ever, ever let systems-level engineers do human interaction
design unless they have displayed a proven secondary talent in that
area. Their opinion of what represents good human-computer interaction
tends to be a bit off-track. (Bruce Tognazzini)

--=-nPsvEtWUnAArLeQb7kdQ
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; CHARSET=3DUTF-8">
<META NAME=3D"GENERATOR" CONTENT=3D"GtkHTML/3.12.1">
</HEAD>
<BODY>
On Sun, 2007-30-09 at 02:54 +0900, Morton Goldberg wrote:
<BLOCKQUOTE TYPE=3DCITE>
<PRE>
<FONT COLOR=3D"#000000">[*] Betrand Meyer of Eiffel fame has often made fun=
of C++'s </FONT>
<FONT COLOR=3D"#000000">reference semantics. He has claimed they are beyond=
the understanding </FONT>
<FONT COLOR=3D"#000000">of mere mortals. He is joking, of course.</FONT>
</PRE>
</BLOCKQUOTE>
<PRE>

</PRE>
I spoke with Dr. Meyer during his trip to China last year.&nbsp; One of the=
things we touched upon (naturally) was programming language design.&nbsp; =
He is not joking when he talks about C++'s reference semantics.&nbsp; Not i=
n the slightest.&nbsp; Don't mistake his general good cheer and good nature=
for not vociferously hating that language.&nbsp; <IMG SRC=3D"cid:119114953=
6.32121.1.camel@isolde" ALIGN=3D"middle" ALT=3D";)" BORDER=3D"0"><BR>
<BR>
<TABLE CELLSPACING=3D"0" CELLPADDING=3D"0" WIDTH=3D"100%">
<TR>
<TD>
-- <BR>
<B>Michael T. Richter</B> &lt;<A HREF=3D"mailto:[email protected]">ttmri=
(e-mail address removed)</A>&gt; (<B>GoogleTalk:</B> (e-mail address removed))<BR>
<I>Never, ever, ever let systems-level engineers do human interaction desig=
n unless they have displayed a proven secondary talent in that area. Their =
opinion of what represents good human-computer interaction tends to be a bi=
t off-track. (Bruce Tognazzini)</I>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>

--=-nPsvEtWUnAArLeQb7kdQ--

--=-srr5oxcmqaEO3Thlj6tF
Content-ID: <1191149536.32121.1.camel@isolde>
Content-Disposition: attachment; filename=smiley-4.png
Content-Type: image/png; name=smiley-4.png
Content-Transfer-Encoding: base64

iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAC/UlEQVR42n2Tf2iUdRzHX9/v8zy3
u91ulnO5pXGXUUsK1yIY9ke0CDQiodbQKCOnNieaIkKI/yRhf0QgCeEqViKUYgUOnTE9G5WtjlqB
TV1bsnl0tV93u93ux3PP93meb/8sKBNf8P7jw/v9+fz1/sD/iQI7gB7AWdApoGPB+w/ihvnI/bHK
bfu2NLF2zUrMcAw8G2d+mIGBi+w/nGE46XQBnTc7cOFAZ+MTO1/bgDBCuIVxnPwIQhgYwXqMQA2q
MMahd+O8fWLmAvAkgLGw/MGbOx55fueuF/FKKVRxHF/NIaQFgO+kcQtjgGZ1cwyjOLXiuyG7DuiV
QLSx4fat2zvX4dmTeOVphDCwvUqkWcVk2mfDnkGEtPCdLEJabH95CfctN7YBUQk83XNoMUJaTE+M
cuT476x9pZfmZ3sI1D7D8fMeP/2a4a3uGaqWt6Ly1zBDdbzadhvAowLomrn0eocqXMeoqCVU+xga
E2mYlKb6sSINtG58gzOnTzGf/BR7+hukWUni52u07p04aS5bdudmAN/NURZ3oSe+RBhhhLTQGsqZ
BKd7Pic3fhSVGwLAtaeoX2IAPGem02kQJrP5EHJRHYb0CHhZtG+CdtFeiezIO2h3Hu17OI6Dqxzy
RR8AadvlXu0WqDSm6O87xkzWx6p+AF/l8N08vmejvRLaV7jKJjNnEwwvJTXtASQk0FecOEsoUs/6
9RuJx8+RGOgjuLgZK7ISzBo8X9L/w1+07RnmnqZ2RpNlrg7lAU4IILrq3sh437GnMCruIFD9IL8M
fsvQpUE+OiO4fGWYRVUGhw+2sablIZJXPiN+cYwPT2b4LaUb/mli94Etsfatm5pwi0kisU1Y4RUI
IfHsSTQalR/lcuJj/ph0Od8/y9G46gI6/13lrzrW1bTs3RwmEKxGyAp8lWN2rkShpCkrzfU/FYkf
53j/rPM18PjNnqn77jrZ/kJLFasaQ4SDglJZk533GUspvjiXZSTFJ8BL3IIosBv4HlBAGrgKvAc8
fGP4b4kpTGRKdd96AAAAAElFTkSuQmCC


--=-srr5oxcmqaEO3Thlj6tF--

--=-hdpctJdvUY+0kkc8aGky
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)

iD8DBQBG/3/3LqyWkKVQ54QRAlTMAJ9rWMo+dVWD9A4HaWFv2g3zp7lMTgCgv7rx
beCnkpW3N90wARaDsNkKrFQ=
=7c0D
-----END PGP SIGNATURE-----

--=-hdpctJdvUY+0kkc8aGky--
 
J

Joshua Ballanco

SpringFlowers said:
how about just a.set_value(3) vs a->set_value(3). what i mean is just
the "." and "->" difference. using a "." in Ruby and "->" in C or C++.
If I think of "a" as a pointer and "." as "->", will that get in trouble
and have any discrepancy for other things.

I think that this will get you into trouble only because you will
continue trying to see Ruby as working from the same OOP paradigm as
C++. There are, actually, two (common) ways to do OOP: one comes from
Simula and the other from SmallTalk.

Basically, Simula-style OOP (which is what C++ uses) treats "objects" as
structs of values and function pointers. When you say "myObject.doThis"
you are dereferencing "myObject", which is actually a pointer to the
object struct, and then invoking the function pointed to by "doThis".

On the other hand, SmallTalk style OOP (which is what Ruby uses) treats
objects as containers (an array or hash if you want) of values and
instantiated from a class. Classes are where the functions are held.
When you say "myObject.doThis", the runtime engine asks the class that
"myObject" was instantiated from if it knows about a "doThis" function.
If it does, then it gives the values held by "myObject" to the "doThis"
function from the class.

The reason that concepts such as pointer and reference do translate well
between C++ and Ruby is because of this difference in paradigms. In the
Simula style, "myObject" has to know where "doThis" resides in memory,
hence why it is important to know if "myObject" is a pointer or a
reference. In the SmallTalk style, "myObject" just has to know what
class it belongs to; the runtime handles keeping track of where
functions live in memory.

This is why, as was said earlier, "myObject" in Ruby is nothing more
than a human-readable label. Without the runtime it is meaningless. To
see what this means in practice, try doing a few assignments in IRB and
after each check the object_id of the variables. You'll see that it
changes with reassignment. This is actually the Ruby runtime applying
the labels to new objects.

Hope that helps!

Cheers,
Joshua Ballanco
 
J

Joshua Ballanco

Joshua said:
The reason that concepts such as pointer and reference do translate well
between C++ and Ruby is because of this difference in paradigms.

Apologies. That should be "do not translate well"
 
D

David A. Black

Hi --

hm,... but is there a problem to think of reference in Ruby as a
"pointer"? will that cause any trouble? I only see that a.value is
not the same as C and C++ would use a->value, but in Ruby we use the "."
to replace the "->" and that's it. Will there be further trouble or
discrepancy to think of Ruby reference as a pointer?

Imagine if you went to a C mailing list and announced that you were
going to call pointers "references". That's the main issue: you're
making up new terminology instead of using the terminology used by
creator of Ruby and by people who have been using and talking about
the language for years and years.

The dot in Ruby is the dot in Ruby. It's not a replacement for
anything else. It's actually pretty easy to understand; it means "send
a message to this object". There's no need to go looking for what it
would mean if this weren't Ruby.


David

--
Upcoming training from Ruby Power and Light, LLC:
* Intro to Ruby on Rails, Edison, NJ, October 23-26
* Advancing with Rails, Edison, NJ, November 6-9
Both taught by David A. Black.
See http://www.rubypal.com for more info!
 
D

David A. Black

Hi --

Yup 'cause '.' is not dereferencing period (pun intended). It is
sending a message

x.a is almost equivalent to
x.send :a.

Variables in Ruby are references, period again ;) but you cannot
dereference them.

And I'd add that bareword identifiers are sometimes *not* variables,
so x.a can mean something even if x is a method call.


David

--
Upcoming training from Ruby Power and Light, LLC:
* Intro to Ruby on Rails, Edison, NJ, October 23-26
* Advancing with Rails, Edison, NJ, November 6-9
Both taught by David A. Black.
See http://www.rubypal.com for more info!
 
M

Michael T. Richter

--=-RpwYA6ZJWIRueyZpGlEz
Content-Type: multipart/related; type="multipart/alternative";
boundary="=-KNQF7uooAOCu7u7YrWkl"


--=-KNQF7uooAOCu7u7YrWkl
Content-Type: multipart/alternative; boundary="=-KIZHje2jedaXqVNnfiqj"


--=-KIZHje2jedaXqVNnfiqj
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

how about just a.set_value(3) vs a->set_value(3). what i mean is just=20
the "." and "->" difference. using a "." in Ruby and "->" in C or C++.=20
If I think of "a" as a pointer and "." as "->", will that get in trouble=20
and have any discrepancy for other things.


I think part of your confusion here, SFAM, is that you're talking about
"pointers" and "references" as if they were distinct entities. They are
not. A pointer is a kind of reference; an implementation detail, in
effect. So C, you see, has references (as do various assemblers, in the
same general form). They are called "pointers" and have some ugly
syntax and semantics:


int a =3D 5; /* a is a box holding 5 */
int *b =3D &a; /* b is a box that points to 5 */
int c =3D a; /* c is a box holding 5 */
int d =3D *b; /* d is a box holding 5 */
a =3D 6; /* a now holds 6, b points to 6, c & d are boxes
holding 5 */


Note how ugly the reference syntax is in C? You have to explicitly tell
it that it is a reference (int *b) and you have to use special syntax to
turn a variable into a reference (&a). Later, when you want to use the
value of the referent, you need, again, to explicitly say so (*b).
(Now, to be fair, there are some pretty cool tricks you can do with C's
references, but we're in the realm of using chainsaws to clip our
fingernails when we use a feature with that much power to do routine
application things.)

References in C++ are either the old-style C references (pointers) or a
newer breed of reference which they confusingly call... references. As
if they were something different. Now the syntax is a bit friendlier:


int a =3D 5; // a is a box holding the value 5
int &b =3D a; // b is a box holding the location of the box a
int c =3D a; // c is a box holding the value 5
int d =3D b; // d is a box holding the value 5
a =3D 6; // a now holds 6, b points to 6, c and d & boxes
holding 5


Note that you still have to specifically say that a variable is a
reference (int &b), but you no longer have to take addresses explicitly
(no &a) and you no longer have to tell the compiler that you mean the
value pointed to, not its location (no *b). Under the covers, though,
it's all the same thing: boxes with values and other boxes that point to
those values. There's only a few minor advantages to using references
over pointers:

1. The cleaner syntax. (You can't make the mistake of accidentally
using an address when you mean the value.)
2. The lower power. (Yes, this is an advantage: you're clipping
your nails with a belt sander instead of a chainsaw. :D)
3. The compiler can better reason about the data involved and can
silently optimize away the actual references if it turns out
that using the data straight is safer and won't have any
semantic impact.


Ruby's references are a completely different implementation. And,
indeed, Ruby's variables in general are radically different in nature.
A variable in Ruby is more like a file handle (another form of
reference, incidentally) or an array index (yet another form of
reference) than it is like a C or C++ variable (a box with a value).


a =3D 5 # a.object_id is 11 in my irb session.
b =3D a # a and b.object_id are both 11.
c =3D a # a, b and c.object_id are all 11.
d =3D b # a, b, c and d.object_id are all 11.
a =3D 6 # a.object_id is now 13. b, c and d.object_id are all
still 11.


Note that here things are radically different from C/C++ (whose
"pointers" and "references" are basically the same thing under the
covers and implemented in mostly the same way). a is not a box with a
value. a is an abstract label (value 11) that is used by the Ruby
runtime to find the value 5. You can view it as a "pointer" of sorts,
but it's probably better to think of it like you'd think of a file
handle returned from an fopen() system call: it's an opaque data
structure containing a lot of information behind the scenes, one of
which happens to be an indirect reference to the value 5. When we
assign a to b, b is now the very same thing. It's just another name, in
effect, for exactly the same object information (which happens to
indirectly reference the value 5). As we proceed to c (from a) and d
(from b), we're basically just attaching more names to the very same
information. It's sort of like doing fopen() several times on the same
file (as long as you ignore issues like seeking, etc.). At the very
end, when I assign 6 to a, what I'm really doing is making a brand new
"handle" that contains, among other things, an indirect reference to the
value 6. This does not change, in any way, the values assigned to b, c
or d. Those are still handles to the same data structure with its
indirect reference to 5.

So....

Short version: Ruby variables are all references. So are C++
"references" and C/C++ "pointers". But the Ruby implementation is
radically different from the C/C++ versions. The sooner you leave your
C/C++-derived notions of what variables "really" are and how they
"really" work behind, the sooner you will understand the subtler aspects
of Ruby's semantics.

If you're still having troubles figuring this out (or if anybody else is
quietly watching this and still getting confused), drop me a line by
private email and I'll hack together some C++ code that kinda-sorta does
the same thing as Ruby so you can understand what's going on in a
variable structure you're more familiar with.

--=20
Michael T. Richter <[email protected]> (GoogleTalk:
(e-mail address removed))
We should sell bloat credits, the way the government sells pollution
credits. Everybody's assigned a certain amount of bloat, and if they go
over, they have to purchase bloat credits from some other group that's
been more careful. (Bent Hagemark)

--=-KIZHje2jedaXqVNnfiqj
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; CHARSET=3DUTF-8">
<META NAME=3D"GENERATOR" CONTENT=3D"GtkHTML/3.12.1">
</HEAD>
<BODY>
On Sun, 2007-30-09 at 15:39 +0900, SpringFlowers AutumnMoon wrote:
<BLOCKQUOTE TYPE=3DCITE>
<PRE>
<FONT COLOR=3D"#000000">how about just a.set_value(3) vs a-&gt;set_value(3)=
what i mean is just </FONT>
<FONT COLOR=3D"#000000">the &quot;.&quot; and &quot;-&gt;&quot; difference.=
using a &quot;.&quot; in Ruby and &quot;-&gt;&quot; in C or C++. </FONT>
<FONT COLOR=3D"#000000">If I think of &quot;a&quot; as a pointer and &quot;=
&quot; as &quot;-&gt;&quot;, will that get in trouble </FONT>
<FONT COLOR=3D"#000000">and have any discrepancy for other things.</FONT>
</PRE>
</BLOCKQUOTE>
<BR>
I think part of your confusion here, SFAM, is that you're talking about &qu=
ot;pointers&quot; and &quot;references&quot; as if they were distinct entit=
ies.&nbsp; They are not.&nbsp; A pointer is a kind of reference; an impleme=
ntation detail, in effect.&nbsp; So C, you see, has references (as do vario=
us assemblers, in the same general form).&nbsp; They are called &quot;point=
ers&quot; and have some ugly syntax and semantics:<BR>
<BR>
<BLOCKQUOTE>
<TT>int a =3D 5;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* a is a box holding 5 =
*/</TT><BR>
<TT>int *b =3D &amp;a;&nbsp;&nbsp;&nbsp; /* b is a box that points to 5=
*/</TT><BR>
<TT>int c =3D a;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* c is a box holding 5 =
*/</TT><BR>
<TT>int d =3D *b;&nbsp;&nbsp;&nbsp;&nbsp; /* d is a box holding 5 */</T=
T><BR>
<TT>a =3D 6;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* a=
now holds 6, b points to 6, c &amp; d are boxes holding 5 */</TT><BR>
</BLOCKQUOTE>
<BR>
Note how ugly the reference syntax is in C?&nbsp; You have to explicitly te=
ll it that it is a reference (int *b) and you have to use special syntax to=
turn a variable into a reference (&amp;a).&nbsp; Later, when you want to u=
se the value of the referent, you need, again, to explicitly say so (*b).&n=
bsp; (Now, to be fair, there are some pretty cool tricks you can do with C'=
s references, but we're in the realm of using chainsaws to clip our fingern=
ails when we use a feature with that much power to do routine application t=
hings.)<BR>
<BR>
References in C++ are either the old-style C references (pointers) or a new=
er breed of reference which they confusingly call... references.&nbsp; As i=
f they were something different.&nbsp; Now the syntax is a bit friendlier:<=
BR>
<BR>
<BLOCKQUOTE>
<TT>int a =3D 5;&nbsp;&nbsp;&nbsp;&nbsp; // a is a box holding the valu=
e 5</TT><BR>
<TT>int &amp;b =3D a;&nbsp;&nbsp;&nbsp; // b is a box holding the locat=
ion of the box a</TT><BR>
<TT>int c =3D a;&nbsp;&nbsp;&nbsp;&nbsp; // c is a box holding the valu=
e 5</TT><BR>
<TT>int d =3D b;&nbsp;&nbsp;&nbsp;&nbsp; // d is a box holding the valu=
e 5</TT><BR>
<TT>a =3D 6;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // a now h=
olds 6, b points to 6, c and d &amp; boxes holding 5</TT><BR>
</BLOCKQUOTE>
<BR>
Note that you still have to specifically say that a variable is a reference=
(int &amp;b), but you no longer have to take addresses explicitly (no &amp=
;a) and you no longer have to tell the compiler that you mean the value poi=
nted to, not its location (no *b).&nbsp; Under the covers, though, it's all=
the same thing: boxes with values and other boxes that point to those valu=
es.&nbsp; There's only a few minor advantages to using references over poin=
ters:
<OL TYPE=3D1>
<LI TYPE=3D1 VALUE=3D1>The cleaner syntax.&nbsp; (You can't make the mi=
stake of accidentally using an address when you mean the value.)
<LI TYPE=3D1 VALUE=3D2>The lower power.&nbsp; (Yes, this is an advantag=
e: you're clipping your nails with a belt sander instead of a chainsaw. <IM=
G SRC=3D"cid:1191152265.32121.17.camel@isolde" ALIGN=3D"middle" ALT=3D":D" =
BORDER=3D"0">)
<LI TYPE=3D1 VALUE=3D3>The compiler can better reason about the data in=
volved and can silently optimize away the actual references if it turns out=
that using the data straight is safer and won't have any semantic impact.
</OL>
<BR>
Ruby's references are a completely different implementation.&nbsp; And, ind=
eed, Ruby's variables in general are radically different in nature.&nbsp; A=
variable in Ruby is more like a file handle (another form of reference, in=
cidentally) or an array index (yet another form of reference) than it is li=
ke a C or C++ variable (a box with a value).<BR>
<BR>
<BLOCKQUOTE>
<TT>a =3D 5&nbsp;&nbsp;&nbsp; # a.object_id is 11 in my irb session.</T=
T><BR>
<TT>b =3D a&nbsp;&nbsp;&nbsp; # a and b.object_id are both 11.</TT><BR>
<TT>c =3D a&nbsp;&nbsp;&nbsp; # a, b and c.object_id are all 11.</TT><B=
R>
<TT>a =3D 6&nbsp;&nbsp;&nbsp; # a.object_id is now 13.&nbsp; b, c and d=
object_id are all still 11.</TT><BR>
</BLOCKQUOTE>
<BR>
Note that here things are <B>radically</B> different from C/C++ (whose &quo=
t;pointers&quot; and &quot;references&quot; are basically the same thing un=
der the covers and implemented in mostly the same way).&nbsp; a is not a bo=
x with a value.&nbsp; a is an abstract label (value 11) that is used by the=
Ruby runtime to find the value 5.&nbsp; You can view it as a &quot;pointer=
&quot; of sorts, but it's probably better to think of it like you'd think o=
f a file handle returned from an fopen() system call: it's an opaque data s=
tructure containing a lot of information behind the scenes, one of which ha=
ppens to be an indirect reference to the value 5.&nbsp; When we assign a to=
b, b is now <B>the very same thing</B>.&nbsp; It's just another name, in e=
ffect, for exactly the same object information (which happens to indirectly=
reference the value 5).&nbsp; As we proceed to c (from a) and d (from b), =
we're basically just attaching more names to the <B>very same information</=
B>.&nbsp; It's sort of like doing fopen() several times on the same file (a=
s long as you ignore issues like seeking, etc.).&nbsp; At the very end, whe=
n I assign 6 to a, what I'm really doing is making a <B>brand new</B> &quot=
;handle&quot; that contains, among other things, an indirect reference to t=
he value 6.&nbsp; This does not change, in any way, the values assigned to =
b, c or d.&nbsp; Those are still handles to the same data structure with it=
s indirect reference to 5.<BR>
<BR>
So....<BR>
<BR>
Short version: Ruby variables are all references.&nbsp; So are C++ &quot;re=
ferences&quot; and C/C++ &quot;pointers&quot;.&nbsp; But the Ruby implement=
ation is <B>radically</B> different from the C/C++ versions.&nbsp; The soon=
er you leave your C/C++-derived notions of what variables &quot;really&quot=
; are and how they &quot;really&quot; work behind, the sooner you will unde=
rstand the subtler aspects of Ruby's semantics.<BR>
<BR>
If you're still having troubles figuring this out (or if anybody else is qu=
ietly watching this and still getting confused), drop me a line by private =
email and I'll hack together some C++ code that kinda-sorta does the same t=
hing as Ruby so you can understand what's going on in a variable structure =
you're more familiar with.<BR>
<BR>
<TABLE CELLSPACING=3D"0" CELLPADDING=3D"0" WIDTH=3D"100%">
<TR>
<TD>
-- <BR>
<B>Michael T. Richter</B> &lt;<A HREF=3D"mailto:[email protected]">ttmri=
(e-mail address removed)</A>&gt; (<B>GoogleTalk:</B> (e-mail address removed))<BR>
<I>We should sell bloat credits, the way the government sells pollution cre=
dits. Everybody's assigned a certain amount of bloat, and if they go over, =
they have to purchase bloat credits from some other group that's been more =
careful. (Bent Hagemark)</I>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>

--=-KIZHje2jedaXqVNnfiqj--

--=-KNQF7uooAOCu7u7YrWkl
Content-ID: <1191152265.32121.17.camel@isolde>
Content-Disposition: attachment; filename=smiley-1.png
Content-Type: image/png; name=smiley-1.png
Content-Transfer-Encoding: base64

iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAC5UlEQVR42n2TW2hUZxSFv/8/Z6Jz
caKJwTGhyWi9glSUglYsRZFWECvYRir6ZL3jJRZLsYJQtAj6oC2IISBqQQg+SKOEKiRStUZ9EbyM
NcPEGSXRmMyJTjLnZOb8Z87fh6RCrbhgP+y1914va234P+qAHUAL4I7W78CW0dl/IN7qT86Kh7bu
2ziP5V/MxgzHoVTAHXpMR8df7P91gMfP3EZg27sE2n/aNnfpzl3fIIwgnp3BzScRwsAYOxmjrBJl
pzn2SxtHmrPtwDIAY/S46eCOj7/euXsdpeEelJPBVzmEDADguxaenQY0nyyIYzh9U28+LMSAVgHU
zZ05IXP1wh60N4Q33I0wgpR8iSF9dGkYt+hgYON7DmawmuLre3y++QnJ7lJcAitajlUgZADlPKXt
VpZNP14nvvg0ucCXHD3VybRll6j/LkE2tBuV78IMxthcPx5gkQAas/d/2KLspwDIQJRQzVo85aCd
RwgzTCAyC60scqkT+CqHNEPcudvFV3t7z5s1NdXfAvjeINKMgPYYfnEBIcvQvkKX8hT6r+F7NlAC
wCv0MXmiAbDatCyLP/58QiaVougFEDKAxkRKA7SP1mpEyC/iey4ClzLDZUJ0xECzUCi2tt/oXNWw
/zxKKSorKzFNk6qqqjf+aq3RWmNZFkopbNum9cwawLpjAlc+qn25KhbuQpZ/ipSS8vJytNZIKVFK
IYRACIGUEsdxKOYSdD7IADQbQH/mOQ0zYt18UJElk51IMpnEsiwAwuEwvb29pNNpEokEk6KvqBg8
zKGmbgby7DGAnJVTtTVRb96YQI45M8ZT/eESamvjRCIRpJQYxkjeqsblCfcf4PuDD7ie8BuB3/5N
4sXbDwc/i8r8FG/oBsJqJlhWwHPzDPSl6O+5z4vUZSapJn4+nuBsu7oG1L/rmU5NickNKxeG2Lt9
+hvyeZ/LlY7XnGvpIdnDOWA970Ed0ADcAhRgAX8DJ4D5by//A0f8RUIabvq3AAAAAElFTkSuQmCC



--=-KNQF7uooAOCu7u7YrWkl--

--=-RpwYA6ZJWIRueyZpGlEz
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)

iD8DBQBG/48/LqyWkKVQ54QRAqdVAJ4o1fqEGesV/L83knIBCs7GWuJeZgCdGI3j
0a3tPvCQ+S2hl6uyGOGvu3U=
=ynOR
-----END PGP SIGNATURE-----

--=-RpwYA6ZJWIRueyZpGlEz--
 
M

Michael T. Richter

--=-6EjWZ/T/9vuAwa4nnL5V
Content-Type: multipart/related; type="multipart/alternative";
boundary="=-BaPW73YpsKHresjBvnaJ"


--=-BaPW73YpsKHresjBvnaJ
Content-Type: multipart/alternative; boundary="=-5Uy0QDPLTPPuftoq+3Hn"


--=-5Uy0QDPLTPPuftoq+3Hn
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

I spoke with Dr. Meyer during his trip to China last year.
One of the things we touched upon (naturally) was programming
language design. He is not joking when he talks about C++'s
reference semantics. Not in the slightest. Don't mistake his
general good cheer and good nature for not vociferously hating
that language. ;)

Just out of curiosity, is this the Dragomir Meyer who wrote "50
pitfalls in C++"? (The only book I ever read about C++, but it was
worth it's money because it made me stay away!)=20


I don't know. I'm not sure what a "Dragomir" is. If it's a name, its
definitely not the guy. Dr. Meyer is Bertrand Meyer, an influential
French computer science type now living in Zurich if memory serves. If
"Dragomir" is a funky way to say "Doctor", then it very well could be.
Dr. Meyer has spent a lot of time in magazine articles, at least, going
over and over the problems with the C++ school of language design.

--=20
Michael T. Richter <[email protected]> (GoogleTalk:
(e-mail address removed))
I can see computers everywhere - except in the productivity statistics!
(Robert Solow)

--=-5Uy0QDPLTPPuftoq+3Hn
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; CHARSET=3DUTF-8">
<META NAME=3D"GENERATOR" CONTENT=3D"GtkHTML/3.12.1">
</HEAD>
<BODY>
On Sun, 2007-30-09 at 21:02 +0900, Robert Dober wrote:
<BLOCKQUOTE TYPE=3DCITE>
<BLOCKQUOTE>
<FONT COLOR=3D"#000000">I spoke with Dr. Meyer during his trip to C=
hina last year.&nbsp; One of the things we touched upon (naturally) was pro=
gramming language design.&nbsp; He is not joking when he talks about C++'s =
reference semantics.&nbsp; Not in the slightest.&nbsp; Don't mistake his ge=
neral good cheer and good nature for not vociferously hating that language.=
&nbsp; </FONT><IMG SRC=3D"cid:1191149536.32121.1.camel@isolde" ALIGN=3D"mid=
dle" ALT=3D";)" BORDER=3D"0">
</BLOCKQUOTE>
</BLOCKQUOTE>
<BR>
<BLOCKQUOTE TYPE=3DCITE>
<FONT COLOR=3D"#000000">Just out of curiosity, is this the Dragomir Mey=
er who wrote &quot;50 pitfalls in C++&quot;? (The only book I ever read abo=
ut C++, but it was worth it's money because it made me stay away!) </FONT><=
BR>
</BLOCKQUOTE>
<BR>
I don't know.&nbsp; I'm not sure what a &quot;Dragomir&quot; is.&nbsp; If i=
t's a name, its definitely not the guy.&nbsp; Dr. Meyer is Bertrand Meyer, =
an influential French computer science type now living in Zurich if memory =
serves.&nbsp; If &quot;Dragomir&quot; is a funky way to say &quot;Doctor&qu=
ot;, then it very well could be.&nbsp; Dr. Meyer has spent a lot of time in=
magazine articles, at least, going over and over the problems with the C++=
school of language design.
<BR>
<TABLE CELLSPACING=3D"0" CELLPADDING=3D"0" WIDTH=3D"100%">
<TR>
<TD>
-- <BR>
<B>Michael T. Richter</B> &lt;<A HREF=3D"mailto:[email protected]">ttmri=
(e-mail address removed)</A>&gt; (<B>GoogleTalk:</B> (e-mail address removed))<BR>
<I>I can see computers everywhere - except in the productivity statistics! =
(Robert Solow)</I>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>

--=-5Uy0QDPLTPPuftoq+3Hn--

--=-BaPW73YpsKHresjBvnaJ
Content-Type: image/png; name="smiley-4.png"
Content-Transfer-Encoding: base64
Content-ID: <1191149536.32121.1.camel@isolde>
Content-Disposition: attachment; filename=smiley-4.png; filename="smiley-4.png"
X-Attachment-Id: 0.0.1

iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAC/UlEQVR42n2Tf2iUdRzHX9/v8zy3
u91ulnO5pXGXUUsK1yIY9ke0CDQiodbQKCOnNieaIkKI/yRhf0QgCeEqViKUYgUOnTE9G5WtjlqB
TV1bsnl0tV93u93ux3PP93meb/8sKBNf8P7jw/v9+fz1/sD/iQI7gB7AWdApoGPB+w/ihvnI/bHK
bfu2NLF2zUrMcAw8G2d+mIGBi+w/nGE46XQBnTc7cOFAZ+MTO1/bgDBCuIVxnPwIQhgYwXqMQA2q
MMahd+O8fWLmAvAkgLGw/MGbOx55fueuF/FKKVRxHF/NIaQFgO+kcQtjgGZ1cwyjOLXiuyG7DuiV
QLSx4fat2zvX4dmTeOVphDCwvUqkWcVk2mfDnkGEtPCdLEJabH95CfctN7YBUQk83XNoMUJaTE+M
cuT476x9pZfmZ3sI1D7D8fMeP/2a4a3uGaqWt6Ly1zBDdbzadhvAowLomrn0eocqXMeoqCVU+xga
E2mYlKb6sSINtG58gzOnTzGf/BR7+hukWUni52u07p04aS5bdudmAN/NURZ3oSe+RBhhhLTQGsqZ
BKd7Pic3fhSVGwLAtaeoX2IAPGem02kQJrP5EHJRHYb0CHhZtG+CdtFeiezIO2h3Hu17OI6Dqxzy
RR8AadvlXu0WqDSm6O87xkzWx6p+AF/l8N08vmejvRLaV7jKJjNnEwwvJTXtASQk0FecOEsoUs/6
9RuJx8+RGOgjuLgZK7ISzBo8X9L/w1+07RnmnqZ2RpNlrg7lAU4IILrq3sh437GnMCruIFD9IL8M
fsvQpUE+OiO4fGWYRVUGhw+2sablIZJXPiN+cYwPT2b4LaUb/mli94Etsfatm5pwi0kisU1Y4RUI
IfHsSTQalR/lcuJj/ph0Od8/y9G46gI6/13lrzrW1bTs3RwmEKxGyAp8lWN2rkShpCkrzfU/FYkf
53j/rPM18PjNnqn77jrZ/kJLFasaQ4SDglJZk533GUspvjiXZSTFJ8BL3IIosBv4HlBAGrgKvAc8
fGP4b4kpTGRKdd96AAAAAElFTkSuQmCC
--=-BaPW73YpsKHresjBvnaJ--

--=-6EjWZ/T/9vuAwa4nnL5V
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)

iD8DBQBG/5a2LqyWkKVQ54QRAiWjAKCBaKhV5H+e0RfLFcPCzqBg3QGbyACfcEA6
bEFPhsARKPD13teYenjQ8D0=
=tYzj
-----END PGP SIGNATURE-----

--=-6EjWZ/T/9vuAwa4nnL5V--
 
A

Austin Ziegler

It's not so mysterious. If you're coming from C/C++, you may find it
helpful to think of a ruby variable as a C void* variable. Assigning
between variables in ruby is just like C assignment between two void* vars.

No, I don't think that's a valid comparison because a void* still
takes up space -- it's a location -- in C++. That is, I can
legitimately do:

void* a = &5;
void* b = &a;

It's *important* for people to understand deeply that Ruby variables
take up no space -- they're labels. If I call something a cat and you
call that same something 'Fluffy', we're still referring to the same
animal, but neither of our names for that animal can easily be
referred to by another name.

Ruby variables are "wafer-thin". They're, as I said, just sticky notes
that can be moved around at will. It's the *objects* that take up the
space.

-austin
 
A

Austin Ziegler

Are you implying Bjarne Stroustrup is some kind of demon? He always
struck me as a very nice person.

So are succubi ;)

Only a being of demonic influence could have come up with the disaster
that is C++. I say this having to program in the language every day.
There's *nothing* redeeming about C++.

-austin
 
A

Austin Ziegler

Doesn't a Ruby variable behave the same way in Java, PHP5, C++, and
Python?

Didn't I just say that they aren't the same?
As long as I view Ruby as a pointer to an object, everything clicks.

But that's exactly the *WRONG* way to look at it. In Pascal, Java,
C/C++, and possibly PHP5 (again, I don't know Python's semantics), a
variable takes up space.

In Ruby, a variable doesn't contain anything. It doesn't contain an
address, it doesn't contain an object, it doesn't contain anything. It's
a label, a name, a sticky note attached to the object.

Forget C++, forget PHP. There are similarities, but you're being
confused by concepts that have ZERO meaning in Ruby. So approach it from
a different direction.

I've seen you ask similar questions on three threads and you're no
closer to understanding, which is why I'm telling you to forget what you
think you know.

Since Ruby variables aren't containers (objects), they can't be referred
to by other variables. In the code:

a = Dog.new("phydeaux")

a is not a pointer. Ever. You call it a pointer, and you're going to
confuse people, especially yourself. What we say is that a is a
reference to "phydeaux", or that it "refers to phydeaux".

More often than not, though, we'll be a bit smarter when we name our
variables:

class Dog
attr_accessor :name

def initialize(name)
@name = name
end

def woof
puts "Woof!"
end
end

def woof(dog)
dog.woof
end

phydeaux = Dog.new("phydeaux")
woof(phydeaux)

Seriously. Forget what you think you know. Because you're not getting it
trying to relate it to anything else, and you're just confusing the
discussion.

Ruby variables are called references. This is just a convention, but
it's the prevailing convention. It's not a pointer of any sort; it's not
a C++ reference. This is because Ruby variables aren't themselves
containers that can be referred to. It's closest to Lisp bindings. If
that's not clear, just remember that it has as much permanence as a
Post-It note.

-austin
 
A

Austin Ziegler

Try this. Without going into implementation details, of which I am
ignorant, a Ruby variable establishes an association between an
identifier and an object [*]. The association is specific to a
particular lexical scope and to a particular execution extent.
Therefore the same identifier can be associated (refer to) different
objects in different scopes and different objects at different points
of the execution. Such an association should perhaps more strictly be
called a binding rather than a reference, but 'reference' is often
used in informal discourse.
[...]
[*] Yes, I know this is not the whole story. I'm trying to keep
things simple.

It's close enough to the whole story as to not matter from the Ruby
programmer's point of view. Implementers care differently.

-austin
 
M

Michael T. Richter

--=-qzgR/PAH+ixbbSbMn8oS
Content-Type: multipart/related; type="multipart/alternative";
boundary="=-dbliHvyiAHXouH158kl7"


--=-dbliHvyiAHXouH158kl7
Content-Type: multipart/alternative; boundary="=-ihc6TMypy46gaAmIwksX"


--=-ihc6TMypy46gaAmIwksX
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

There's *nothing* redeeming about C++.


Sure there is. I am married because of C++. Before C++ I kinda-sorta
enjoyed my job. After the C++ fiasco hit the industry in the '90s, I
increasingly despised it. Finally I tossed it all away and got a job
that didn't involve 12+ hours per day, 7 days per week of hating my work
and my life. This allowed me the social life I needed to, you know,
actually meet people and finally wind up married. :D

Had I been programming with a language that didn't suck over that
period, I'd still be working 12+ hours per day, 7 days per week. I just
wouldn't have hated my life in the process. ;)

--=20
Michael T. Richter <[email protected]> (GoogleTalk:
(e-mail address removed))
Theory is knowledge that doesn't work. Practice is when everything works
and you don't know why. (Hermann Hesse)

--=-ihc6TMypy46gaAmIwksX
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; CHARSET=3DUTF-8">
<META NAME=3D"GENERATOR" CONTENT=3D"GtkHTML/3.12.1">
</HEAD>
<BODY>
On Sun, 2007-30-09 at 22:45 +0900, Austin Ziegler wrote:
<BLOCKQUOTE TYPE=3DCITE>
<PRE>
<FONT COLOR=3D"#000000">There's *nothing* redeeming about C++.</FONT>
</PRE>
</BLOCKQUOTE>
<BR>
Sure there is.&nbsp; I am married because of C++.&nbsp; Before C++ I kinda-=
sorta enjoyed my job.&nbsp; After the C++ fiasco hit the industry in the '9=
0s, I increasingly despised it.&nbsp; Finally I tossed it all away and got =
a job that didn't involve 12+ hours per day, 7 days per week of hating my w=
ork and my life.&nbsp; This allowed me the social life I needed to, you kno=
w, actually meet people and finally wind up married.&nbsp; <IMG SRC=3D"cid:=
1191162656.32121.46.camel@isolde" ALIGN=3D"middle" ALT=3D":D" BORDER=3D"0">=
<BR>
<BR>
Had I been programming with a language that didn't suck over that period, I=
'd still be working 12+ hours per day, 7 days per week.&nbsp; I just wouldn=
't have hated my life in the process.&nbsp; <IMG SRC=3D"cid:1191162656.3212=
1.47.camel@isolde" ALIGN=3D"middle" ALT=3D";)" BORDER=3D"0"><BR>
<BR>
<TABLE CELLSPACING=3D"0" CELLPADDING=3D"0" WIDTH=3D"100%">
<TR>
<TD>
-- <BR>
<B>Michael T. Richter</B> &lt;<A HREF=3D"mailto:[email protected]">ttmri=
(e-mail address removed)</A>&gt; (<B>GoogleTalk:</B> (e-mail address removed))<BR>
<I>Theory is knowledge that doesn't work. Practice is when everything works=
and you don't know why. (Hermann Hesse)</I>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>

--=-ihc6TMypy46gaAmIwksX--

--=-dbliHvyiAHXouH158kl7
Content-ID: <1191162656.32121.47.camel@isolde>
Content-Disposition: attachment; filename=smiley-4.png
Content-Type: image/png; name=smiley-4.png
Content-Transfer-Encoding: base64

iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAC/UlEQVR42n2Tf2iUdRzHX9/v8zy3
u91ulnO5pXGXUUsK1yIY9ke0CDQiodbQKCOnNieaIkKI/yRhf0QgCeEqViKUYgUOnTE9G5WtjlqB
TV1bsnl0tV93u93ux3PP93meb/8sKBNf8P7jw/v9+fz1/sD/iQI7gB7AWdApoGPB+w/ihvnI/bHK
bfu2NLF2zUrMcAw8G2d+mIGBi+w/nGE46XQBnTc7cOFAZ+MTO1/bgDBCuIVxnPwIQhgYwXqMQA2q
MMahd+O8fWLmAvAkgLGw/MGbOx55fueuF/FKKVRxHF/NIaQFgO+kcQtjgGZ1cwyjOLXiuyG7DuiV
QLSx4fat2zvX4dmTeOVphDCwvUqkWcVk2mfDnkGEtPCdLEJabH95CfctN7YBUQk83XNoMUJaTE+M
cuT476x9pZfmZ3sI1D7D8fMeP/2a4a3uGaqWt6Ly1zBDdbzadhvAowLomrn0eocqXMeoqCVU+xga
E2mYlKb6sSINtG58gzOnTzGf/BR7+hukWUni52u07p04aS5bdudmAN/NURZ3oSe+RBhhhLTQGsqZ
BKd7Pic3fhSVGwLAtaeoX2IAPGem02kQJrP5EHJRHYb0CHhZtG+CdtFeiezIO2h3Hu17OI6Dqxzy
RR8AadvlXu0WqDSm6O87xkzWx6p+AF/l8N08vmejvRLaV7jKJjNnEwwvJTXtASQk0FecOEsoUs/6
9RuJx8+RGOgjuLgZK7ISzBo8X9L/w1+07RnmnqZ2RpNlrg7lAU4IILrq3sh437GnMCruIFD9IL8M
fsvQpUE+OiO4fGWYRVUGhw+2sablIZJXPiN+cYwPT2b4LaUb/mli94Etsfatm5pwi0kisU1Y4RUI
IfHsSTQalR/lcuJj/ph0Od8/y9G46gI6/13lrzrW1bTs3RwmEKxGyAp8lWN2rkShpCkrzfU/FYkf
53j/rPM18PjNnqn77jrZ/kJLFasaQ4SDglJZk533GUspvjiXZSTFJ8BL3IIosBv4HlBAGrgKvAc8
fGP4b4kpTGRKdd96AAAAAElFTkSuQmCC


--=-dbliHvyiAHXouH158kl7
Content-ID: <1191162656.32121.46.camel@isolde>
Content-Disposition: attachment; filename=smiley-1.png
Content-Type: image/png; name=smiley-1.png
Content-Transfer-Encoding: base64

iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAC5UlEQVR42n2TW2hUZxSFv/8/Z6Jz
caKJwTGhyWi9glSUglYsRZFWECvYRir6ZL3jJRZLsYJQtAj6oC2IISBqQQg+SKOEKiRStUZ9EbyM
NcPEGSXRmMyJTjLnZOb8Z87fh6RCrbhgP+y1914va234P+qAHUAL4I7W78CW0dl/IN7qT86Kh7bu
2ziP5V/MxgzHoVTAHXpMR8df7P91gMfP3EZg27sE2n/aNnfpzl3fIIwgnp3BzScRwsAYOxmjrBJl
pzn2SxtHmrPtwDIAY/S46eCOj7/euXsdpeEelJPBVzmEDADguxaenQY0nyyIYzh9U28+LMSAVgHU
zZ05IXP1wh60N4Q33I0wgpR8iSF9dGkYt+hgYON7DmawmuLre3y++QnJ7lJcAitajlUgZADlPKXt
VpZNP14nvvg0ucCXHD3VybRll6j/LkE2tBuV78IMxthcPx5gkQAas/d/2KLspwDIQJRQzVo85aCd
RwgzTCAyC60scqkT+CqHNEPcudvFV3t7z5s1NdXfAvjeINKMgPYYfnEBIcvQvkKX8hT6r+F7NlAC
wCv0MXmiAbDatCyLP/58QiaVougFEDKAxkRKA7SP1mpEyC/iey4ClzLDZUJ0xECzUCi2tt/oXNWw
/zxKKSorKzFNk6qqqjf+aq3RWmNZFkopbNum9cwawLpjAlc+qn25KhbuQpZ/ipSS8vJytNZIKVFK
IYRACIGUEsdxKOYSdD7IADQbQH/mOQ0zYt18UJElk51IMpnEsiwAwuEwvb29pNNpEokEk6KvqBg8
zKGmbgby7DGAnJVTtTVRb96YQI45M8ZT/eESamvjRCIRpJQYxkjeqsblCfcf4PuDD7ie8BuB3/5N
4sXbDwc/i8r8FG/oBsJqJlhWwHPzDPSl6O+5z4vUZSapJn4+nuBsu7oG1L/rmU5NickNKxeG2Lt9
+hvyeZ/LlY7XnGvpIdnDOWA970Ed0ADcAhRgAX8DJ4D5by//A0f8RUIabvq3AAAAAElFTkSuQmCC



--=-dbliHvyiAHXouH158kl7--

--=-qzgR/PAH+ixbbSbMn8oS
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)

iD8DBQBG/7MiLqyWkKVQ54QRAvRyAJ9egayB5Lcf1Jg05bNKlREVC6pGdwCfWorh
hFtQD77ZBt7a9q2dg+pZcJk=
=n0tP
-----END PGP SIGNATURE-----

--=-qzgR/PAH+ixbbSbMn8oS--
 
S

SpringFlowers AutumnMoon

7stud said:
What makes you think that is the op's goal?

I asked similar question before although at that time I didn't know the
word reference can mean "alias that can't change where it points to" in
C++ and the general CS field. the word we in use in Ruby is also
reference. so trying to clarify how it relates to the rest of the
world.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,015
Latest member
AmbrosePal

Latest Threads

Top