logo       

Re: Where to 'declare' symbols: msg#00118

lang.smalltalk.squeak.beginners

Subject: Re: Where to 'declare' symbols

Sorry... probably 'symbol' isn't the right word, since as far as I know, something like #aSymbol doesn't have any value other than it's own identity.

What I really want is a named constant that has a value. Like iAmAConstant = 5. Is there such a thing in Smalltalk?

-- John


On Aug 13, 2007, at 9:43 PM, John Almberg wrote:

I want to eliminate a 'magic number' used by methods in a single class. I'd like to do that by creating a symbol that would be available to all the methods in the class. Where and how should I create such a symbol? I can't seem to find an example anywhere.

Thanks: John

_______________________________________________
Beginners mailing list
Beginners@xxxxxxxxxxxxxxxxxxxxxxxxxx
http://lists.squeakfoundation.org/mailman/listinfo/beginners


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise