>> From: Sheridan Mahoney <[email protected]> >> Date: December 3, 2009 11:04:19 PM GMT+01:00 >> To: [email protected] >> Subject: Re: getting rid of Symbol >> new: ? >> Reply-To: [email protected] >> >> >> A colleague and I are investigating the ImageSegment class and its methods, >> we came across an issue I would like to get external opinions on. Newbie >> alert, BTW (at least one of us, no names mentioned...). Also, this is not a >> problem that will affect many users, but it is familiarizing us with the >> check-in process, slices, etc. While working on ImageSegment tests, we >> discovered a problem on trying to load segments that had Symbols in the root >> array. It is possible to create 2 ByteSymbols with the same sequence of >> characters. :( In trying to track down how this is possible, we came >> across a side issue, that ByteSymbol new: had the capacity to create >> multiple new ByteSymbols with the same number of nil characters (as in, >> initialized with nil). We want to dissallow Symbol new: , which would >> cause people to use one of the nicer methods for Symbol/ByteSymbol creation >> (namely, one which checks that the sequence of characters doesn't already >> exist, as part of the creation process). We have a fix we want to check in, >> but currently it breaks a test case in the SymbolTest class, which is >> checking that new: works. We also changed the intern: method on the >> class side of Symbol to use basicNew: instead of new: . Are there >> reasons to keep 'Symbol new:' , that outweigh the reasons to get rid of it? >> Many thanks, >> and Cheers, >> Sheri Mahoney
I'm not sure that forbidding new: is a good idea. In Smalltalk it is rare to forbid such methods. Do you know from where your two byteSymbols were coming? Stef _______________________________________________ Pharo-project mailing list [email protected] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
