Found a way to get c a trains, and even a sensible implementation for c c 
trains with modified parsing that may be convenient for other purposes as well.

eval =: 1 : ' a: 1 :  m'
CONJ =: 2 : 'v eval u'

   +:  + CONJ'@:' 
+:@:+ 
   +: +:  + CONJ'@:' CONJ'@:' 
+:@:(+:@:+) 

(CONJ '@:') is an adverb which after consuming one parameter returns an adverb. 
 The last expression is v v v c c

So as long as you are willing to parse conjunctions as u v c instead of u c v, 
you can treat them as adverbs, and so put them in adverb trains.

    CONJ'^:'/ 
(CONJ'^:')/ 
   1 CONJ'^:'/ 
(^:1)/ 
      + 2 CONJ'^:'/
  NB. adds all except tail twice... not completely sure why.
+^:2/ 
   + 2 CONJ'^:'/ i. 4 4 
36 43 50 57 
   + 1 CONJ'^:'/ i. 4 4 
24 28 32 36 

   +/ 1 CONJ '"' 2 CONJ'^:' i. 4 4 4 
120 376 632 888 
   +/ 2 CONJ'^:' i. 4 4 4 
480 496 512 528

needs more utilities to be more useful, but this looks promising.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to