From: Ken Bloom Date: 2009-02-19T14:39:49+09:00 Subject: Re: Tree structure - how do we link nodes together? On Tue, 17 Feb 2009 20:25:28 -0500, Aldric Giacomoni wrote: > I know I could just use rubytree, which looks quite nice, but I'd like > to see what you guys would do about creating a tree and linking the > nodes together. > In C++ we'd just make pointers, so how would we do the equivalent in > Ruby? The easiest equivalence is that essentially everything in Ruby is a pointer and the . operator in Ruby is the equivalent of C++'s -> (This is similar to how Java behaves as well.) The = operator changes where the pointer points. There's no such thing in Ruby as a pointer to a pointer, nor is there any such thing as a variable that's not a pointer at all. --Ken -- Chanoch (Ken) Bloom. PhD candidate. Linguistic Cognition Laboratory. Department of Computer Science. Illinois Institute of Technology. http://www.iit.edu/~kbloom1/