Scalars

In Ruby, do you use the world “scalar” as it’s used in Perl? (variables
that hold a single value).

Or is there a different term?

Daniel.

Hi –

···

On Sun, 1 Dec 2002, Daniel Carrera wrote:

In Ruby, do you use the world “scalar” as it’s used in Perl? (variables
that hold a single value).

Or is there a different term?

There’s no equivalent term, because any variable can hold a reference
to any object.

David


David Alan Black
home: dblack@candle.superlink.net
work: blackdav@shu.edu
Web: http://pirate.shu.edu/~blackdav

In Ruby, do you use the world “scalar” as it’s used in Perl? (variables
that hold a single value).

Or is there a different term?

There’s no equivalent term, because any variable can hold a reference
to any object.

That’s also true in Perl. What I mean is, “a variable that is not an
array or a hash”.

Hi –

···

On Sun, 1 Dec 2002, Daniel Carrera wrote:

In Ruby, do you use the world “scalar” as it’s used in Perl? (variables
that hold a single value).

Or is there a different term?

There’s no equivalent term, because any variable can hold a reference
to any object.

That’s also true in Perl. What I mean is, “a variable that is not an
array or a hash”.

That distinction exists in Ruby only at the level of the object. The
variables themselves all behave the same way (they hold references to
objects).

David


David Alan Black
home: dblack@candle.superlink.net
work: blackdav@shu.edu
Web: http://pirate.shu.edu/~blackdav