This avoidance of unnecessary restrictions is consonant with a philosophy underlying J and other Array Programming Languages that is antithetical to many conventional languages which, for instance, see strong-typing as unequivocally A Good Thing.
For instance, instead of having "True" and "False" as a distinct boolean datatype, J uses 1 and 0 which also happen to work as integers (or even floating-point, if that makes sense). This allows us to simply do something like add up all the true values in an array without fussing with busy-work like typecasting to convert booleans to ints. This permissive way of doing things also encourages us to understand deeper relations between functions. So, boolean "And" is "*." and "Or" is "+." which suggests that "And" is like multiplication in the boolean domain while "Or" is like addition. If you study the Vocabulary page, you'll see many rich connections like this. The permissiveness of base notation makes me think of a known bug in a time differencing routine I wrote in which I'll sometimes end up with something like minutes and seconds as "1 60" instead "2 0". I suspect now that I can fix this by using base notation. On Sun, May 10, 2009 at 1:41 PM, Martin Kreuzer <[email protected]> wrote: > > 'So my question remains: is there a purpose that > a function base-n (xby) will accept "foreign" > digits without complaining..?' asks Martin Kreuzer. > This question and its generalizations pops up now > and then. Lets turn it around: is there a purpose > complaining rather than accepting a generalization? > > Well, I'm not complaining -- it's probably to do > with my background, where every function was > required to first check whether the parameters > were within bounds. I've already learned that > some programmers seem to be quite happy with these generalizations. M > > --- Den søn 10/5/09 skrev Martin Kreuzer > <<http://jsoftware.com/cgi-bin/mailman/listinfo/programming>info > at airkreuzer.com>: > > > Fra: Martin Kreuzer > <<http://jsoftware.com/cgi-bin/mailman/listinfo/programming>info > at airkreuzer.com> > > Emne: [Jprogramming] Base Notation > > Til: > <http://jsoftware.com/cgi-bin/mailman/listinfo/programming>programming > at jsoftware.com > > Dato: søndag 10. maj 2009 09.21 > > > While fumbling around with base > > notation, I found > > > 5b34 > > > 19 > > > 5b35 > > > 20 > > > 5b36 > > > 21 > > > while I was waiting to see an error message for the > > second and third > > > case (using digits not in the set for this base, > > beyond 0 1 2 3 4). > > > This is puzzling me. > > > > Seems consistent to me. > > 5b36 > > There are 6 "ones" (5^0) and 3 "fives" (5^1), that makes > > 21. > > > > Obviously you can get 21 using 5b41 too. > > > > --- > > > > Thanks, Ric & Devon... > > > > Let's take another example to make myself a bit more > > clear: > > > > 2b1010 > > 10 > > 2b2020 > > 20 > > 2b3030 > > 30 > > > > I'm ready to admit that I can plainly see how this result > > is > > generated (as Ric pointed out); however I've never come > > across any > > binary integer of the form 2020 or 3030. So my question > > remains: is > > there a purpose that a function base-n (xby) will accept > > "foreign" > > digits without complaining..? > > > > > > > > ---------------------------------------------------------------------- > > For information about J forums see > <http://www.jsoftware.com/forums.htm>http://www.jsoftware.com/forums.htm > > > > > > > > --- > avast! Antivirus: Outbound message clean. > Virus Database (VPS): 090509-0, 09.05.2009 > Tested on: 10.05.2009 17:41:57 > avast! - copyright (c) 1988-2009 ALWIL Software. > http://www.avast.com > > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > -- Devon McCormick, CFA ^me^ at acm. org is my preferred e-mail ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
