Very interesting Henry. This seems to be a coincidental side effect of the fact that the integer flag for booleans is less than the flag for literals as specified here: http://www.jsoftware.com/docs/help701/dictionary/dx003.htm
Now, I wonder if forcing the boolean to stay numeric would wreak havoc elsewhere? On Wed, Feb 19, 2014 at 4:48 PM, Henry Rich <[email protected]> wrote: > Here's the answer: > > test =: ' ' , [: {. '' , > > > test a: > > test <$0 > |domain error: test > | test<$0 > test <0$0 > > Henry Rich > > > On 2/18/2014 12:51 AM, km wrote: > >> Henry, experiments with 3!:3 make me guess <0$0 as a correct definition >> of a: but I have no clue how to define verb test. --Kip Murray >> >> Sent from my iPad >> >> On Feb 15, 2014, at 11:28 AM, Henry Rich <[email protected]> wrote: >>> >>> The Dictionary defines a: as <$0, but in fact the two are not >>> interchangeable. >>> >>> The challenge is to demonstrate this: write a verb that produces a >>> result when applied to a:, but gives domain error when applied to <$0 . >>> >>> test a: >>> >>> test <$0 >>> |domain error: test >>> | test<$0 >>> >>> >>> Then, give a correct definition of a: . >>> >>> Henry Rich >>> ---------------------------------------------------------------------- >>> For information about J forums see http://www.jsoftware.com/forums.htm >>> >> ---------------------------------------------------------------------- >> For information about J forums see http://www.jsoftware.com/forums.htm >> >> ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
