On Mon, Sep 26, 2011 at 11:17 AM, The Geeko <[email protected]> wrote: > Raul Miller <rauldmiller@...> writes: >> I believe that any use of m n u v x y as globals, in books, should be >> considered a bug and reported to the author. > > I beg to differ with you on this point. From pouring through the > Dictionary[1] > (i.e., its very definition), there is no mention of reserved global names, > other > than those which are defined by the language.
Have you read the second paragraph here: http://www.jsoftware.com/help/dictionary/d001.htm or footnote 3, here: http://jsoftware.com/help/dictionary/d310n.htm ? My reading of these two concepts suggests that x and y are sometimes prohibited as global names. And, it's easy enough to conduct an experiment to test this concept: 3 :'y=:0' 0 |domain error | y =:0 So it looks to me as if the implementation matches the dictionary... > This is why, for example, the language elements like Integers ('i.'), Memo > ('M.'), and Symbol ('s:') are defined with 2 characters[2]. This makes for a > very smart grammar which does not need to *reserve* words unnecessarily and, > therefore, permits the language to be thoroughly expressive. Yes, originally, the language used x. y. u. v. m. n. However, this caused problems with the syntax for locales. Arguably, the fault is in the syntax for locales rather than in those names. That said, changing how locales work would have been a huge change and may have introduced additional issues. > It is also, I am guessing, the reason that[3] x and y were earlier designated > as > 'x.' and 'y.'. It is this last fact that explains why so many books include > 'x' > and 'y' as global words. And rightly so, imho. By not reserving language > elements unnecessarily, users are able to be more expressive and are required > to > remember fewer exceptions. So, if we went back to the old way of doing things, and if y. is a reference to an object, how do we access the object? Anyways, consistency is only good when it achieves something useful. Language implementations routinely break consistency when the language implementer deems the issue worthy. Thus, for example, in C, you cannot do: int default= 0; -- Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
