Enumerated Scalar

M

Mike Stephens

As a one time Pascal programmer - does Ruby have the concept of an
enumerated scalar? It seems to have enumerations but I can't see a
standard method that recognizes inate ordering eg EObj.next, EObj < FObj
etc
 
R

Robert Klemme

As a one time Pascal programmer - does Ruby have the concept of an
enumerated scalar? It seems to have enumerations but I can't see a
standard method that recognizes inate ordering eg EObj.next, EObj < FObj
etc

There is definitively nothing built in. You have to create this
yourself or use one of the libs out there that implement enums.

http://raa.ruby-lang.org/project/enum/
http://raa.ruby-lang.org/search.rhtml?search=enum

Also, often Symbols are used to represent fixed values.

Kind regards

robert
 

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

Forum statistics

Threads
474,142
Messages
2,570,820
Members
47,367
Latest member
mahdiharooniir

Latest Threads

Top