benjohn
3/20/2006 9:45:00 PM
On 17 Mar 2006, at 16:49, Gregory Seidman wrote:
> On Sat, Mar 18, 2006 at 01:42:51AM +0900, benjohn@fysh.org wrote:
> } I'd like to fill a module with valueless constants (because I
> don't care
> } about the actual values, just that they are uneque, and named) -
> is that
> } a good thing to do, and can I do that? :)
> }
> } I tried:
> }
> } module AnEnum
> } :ValueOne
> } :ValueTwo
> } ...
> } end
> }
> } But mentioning a constant's sysmbol doesn't define it.
>
> Those are symbols, not constants. And they are what you want. You
> don't
> need to define them anywhere. They are defined by being used.
Hi Greg, thank you ... I suppose what I wanted was to be able to write:
AnEnum::ValueIDidntDefine
... in some code, and have Ruby come back and bash me for talking
about something that's not in the set of allowed values.