predefined variables and constants question

S

Simon Harrison

hi all. pages 333 to 337 in pickaxe2 list a whole load of global
variables/constants, execution environment variables, standard objects
etc.

Is it just me or does this not seem to break with the usually
beautifully tidy, object oriented design of Ruby? I would have thought
all such things would have been defined in a class named something like
'Global'

I do not mean any offence to Matz and co. and there are probably good
reasons for things being as they are.
 
A

ara.t.howard

hi all. pages 333 to 337 in pickaxe2 list a whole load of global
variables/constants, execution environment variables, standard objects etc.

Is it just me or does this not seem to break with the usually beautifully
tidy, object oriented design of Ruby? I would have thought all such things
would have been defined in a class named something like 'Global'

I do not mean any offence to Matz and co. and there are probably good
reasons for things being as they are.

but that woudn't be global then would it ;-)

-a
 
S

Simon Harrison

but that woudn't be global then would it ;-)

Not sure I follow. Class Object is available at all times throughout a
ruby program so is therefore global. Wouldn't a class called Global (or
whatever) also be? Then one could maybe do:

Global.constants

Global.variables
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top