On 12/13/05, braver <[EMAIL PROTECTED]> wrote:
>
> Um, I guess I wonder what it "means" in terms of syntactic sugar -- the
> semantics is clear, and that's the claimed ruby's hallmark.  I don't
> yet have a handle on those "symbol" things like :poll ("they're like
> strings" --huh?), and what's belongs_to?  I wonder what would be the
> closest pythonic syntax...

Pretty far off-topic here.  This'll be my only post on-list.

A :foo symbol is like a global constant "foo".  In C, you might extern
"foo" so that lots of instances of "foo" don't take up loads of memory
and so that you can very efficiently say that :foo = :foo.

Languages make all kinds of crazy optimization choices:
http://fishbowl.pastiche.org/2005/04/27/the_string_memory_gotcha

Think of it this way: ruby saves you a couple keystrokes, and saves
you the annoyance of typing something like:
public final foo As String = "foo"

Reply via email to