[ABE.pm] Ruby Q

Faber Fedor faber at linuxnj.com
Mon Apr 17 14:00:49 PDT 2006


On 16/04/06 22:11 -0400, Ricardo SIGNES wrote:
> * Faber Fedor <faber at linuxnj.com> [2006-04-16T22:02:24]
> > I finally started playing with Ruby.  So far, so good.  However, in my
> > readings, there's one important (IMO) thing I haven't come across: what
> > is Ruby's equivalent to Perl's "my" declaration?  
> > 
> > I *really* hate creating variables by mistyping.
> 
> Tough luck.  Ruby's variables are created by assignment.  Using a symbol as
> an rvalue in an expression before it's been assigned a value throws a
> NameError, just like Python.  

That I can live with.  It's the unintended lvalues that I don't want.

> Ruby's scoping is more sane than Python's, but
> you can still shoot your foot more easily than in Perl, 

Hmm, I assumed the scoping would be Perl-like.  I'd better read up on
that.

-- 
 
Regards,
 
Faber Fedor
President
Linux New Jersey, Inc.
908-320-0357
800-706-0701

http://www.linuxnj.com





More information about the ABE-pm mailing list