Its only a bad thing in terms of software maintenance and interaction from components that don't know about each other: Its a valid assumption in creating your objects that users of your code (including you) will never use the same locale numbers for their own variables, and simply risk breaking if that assumption is violated.
Forbidding the practise is not the right approach. In addition to the practical difficulty of letting conew be the one and only possible creator of numbered locales, there's real applications or performance reasons in creating your own, and its up to those that come up with 'special applications' for numbered locales to do so in a matter compatible with the mainstream application. Creating instance information based on a hash value with potential merging of info from many sources (instead of one class definition) that could be added in any order. If the hash value can determine considerable information in the locale and serve as a filter for how to modify, select/group and extend locales, then its a better 'key' than an arbitrary alphanumberic handle, and yet another powerful J mechanism. One way to avoid 'collisions' between your 'hand keyed' locales and the mainstream numbered locales is to limit them to a range (say above 1000), and pre-create a flagged boundary locale # so that conew will return numbers outside your range. A very simple reservation system can accomodate multiple hashed locale systems each obtaining their own unique offset range for allowable locale values. ----- Original Message ---- From: bill lam <[EMAIL PROTECTED]> To: Programming forum <[email protected]> Sent: Wednesday, October 18, 2006 9:53:21 AM Subject: Re: [Jprogramming] Question regarding locales bill lam wrote: > Pascal Jasmin wrote: >> You have a good point that 18!:0 can't be used to tell if an object has been >> destroyed anymore, if the users of your code could also create random >> numbered locales, but then again, the practise is generally a bad idea that >> can gain performance benefits for narrow applications, but any "mixed use" >> (where numbered locales can be one of many types of content) of numbered >> locales is going to hurt performance, and beg for trouble, but its still >> doable: >> > > Sorry I cannot understand your argument. Either I misread your msg or you > misread mine. > On reading the whole thread again, I might understand your msg. As Chris and you said, 18!:3 a numbered string is a bad thing, but such an idea never occurred to me, so that I only referred to 18!:3'' in my previous msg. If 18!:3 a numbered string is bad and no counter example be available, I suggest raising an domain error if attempted. -- regards, bill ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
