Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!uwvax!oddjob!gargoyle!ihnp4!inuxc!iuvax!pur-ee!uiucdcs!uiucdcsp!johnson From: johnson@uiucdcsp.cs.uiuc.edu Newsgroups: comp.lang.smalltalk Subject: Re: literals Message-ID: <80500010@uiucdcsp> Date: Sat, 11-Jul-87 13:47:00 EDT Article-I.D.: uiucdcsp.80500010 Posted: Sat Jul 11 13:47:00 1987 Date-Received: Mon, 13-Jul-87 00:36:43 EDT References: <938@argus.UUCP> Lines: 22 Nf-ID: #R:argus.UUCP:938:uiucdcsp:80500010:000:1274 Nf-From: uiucdcsp.cs.uiuc.edu!johnson Jul 11 12:47:00 1987 I claimed that it was a flaw in Smalltalk that "constant arrays" were not constants, and offered symbols as an example of a real constant. jan@tekchips claimed that I was wrong, since one could change a symbol using basicAt:put:. This is entirely beside the point. If one mistakenly hands a symbol to an object that thinks it is a string, the object will send at:put: to it and find out that it is a "constant", since it doesn't understand at:put:. basicAt:put: is really only for debuggers and the like. If someone comes complaining to me that an object using basicAt:put: changed some other object (like a dictionary or symbol) in unforseen ways, I will NOT be sympathetic. jan@tekchips says that if I want constants, I should make them by subclasses. That is exactly my complaint. The flaw in Smalltalk is that I cannot. So-called constant arrays are by default of class Array, which is not constant. They should instead be in class ConstantArray, which has no at:put: message. It will probably have a basicAt:put: message, but that won't bother me. "Symbols are objects, and like all other objects, they may entertain requests to change their contents." However, symbols are usually very reluctant to change their contents. Other "constants" should be, too.