The spoiler to the challenge below (
http://www.jsoftware.com/pipermail/programming/2007-December/009267.html )
follows after several blank lines.

The challenge is to give a counterexample to the following J myth.

1.  Extreme: J "Conjunctions and adverbs apply" only "to noun or verb
arguments."  In other words, the challenge is to successfully pass an adverb
argument or a conjunction argument to an adverb or to a conjunction.

Hint: After I mentioned to Roger, the last time he visited Hoboken, that it
was possible he reportedly woke up in the middle of the night of the same
day with the solution and closed this back door afterwards, but the facility
is still  available in version J601c (and earlier).













































First a hint in the form of a more specific challenge: given the conjunction
test=. 2 : '(+ x) (* y)' find a way to pass @ to the adverb [ test so the
result is,

   (+ [) (* @)
*@(+ [)

Also, pass / to the adverb test ] so the result is,

   (+ /) (* ])
+/ (* ])














































   9!:14 '' NB. J version J601c
j601/2006-11-17/17:05

   adv=.  1 :
   conj=. 2 :
   
   test=. '(+ x) (* y)'conj
   [ test ] NB. Legal usage
(+ [) (* ])
   
   in=. '/'adv
   at=. '@'adv
   
   0 in NB. /
/
   0 at NB. @
@
   
   0 (at ([ test)) NB. Illegal usage
*@(+ [)

   (0 at) ([ test) NB. Behavior according to the specification
|syntax error
|       (0 at)([test)
|[-13]

   0 (in (test ])) NB. Illegal usage
+/ (* ])

A similar way,
   
   In=. /
   At=. @
   
   'At'~ NB. @
@
   'In'~ NB. /
/
   
   'At' (~ ([ test)) NB. Illegal usage
*@(+ [)
*@(+ [)
   'In' (~ (test ])) NB. Illegal usage
+/ (* ])
   



----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to