an advantage of eval is that it forms tacit expressions. To better explain the last line in original message:
+: '@' eval +'/' eval +:@(+/) + '3&' eval +'/' eval 3&+ +/ The last line is again interesting: (3&+ +/) 1 2 3 9 12 15 + '3&' eval +'/' eval 1 2 3 9 so its not quite a true tacit expression in that its evaluated as a non train. Can be interesting and/or easily avoided/made standard: +: + '3&' eval +'/' eval 1 2 3 18 +: + '3&' eval +'/' eval +: 3&+ +/ (+ '3&' eval +'/' eval) 1 2 3 9 12 15 ----- Original Message ----- From: Pascal Jasmin <[email protected]> To: Programming forum <[email protected]> Cc: Sent: Saturday, April 5, 2014 12:26:42 PM Subject: [Jprogramming] an improvement to apply and perhaps anon evoke apply does not work with dyadic verbs, and cannot produce modifiers. Consider the following simple looking eval function. eval =: 1 : ' a: 1 : m' 2 '+' eval 1 2 3 3 4 5 + '/' eval 1 2 3 6 '+/' eval(+:@) 1 2 3 12 +:@+'/' eval 1 2 3 22 +: +'/' eval 1 2 3 12 (+: '@' eval +)'/' eval 1 2 3 22 +: '@' eval +'/' eval 1 2 3 12 The last statement is interesting because it seems to alter the normal conjunction train processing (sometimes in desirable ways) instead of just grabbing a single token as v. < '@' eval +'/' eval 1 2 3 NB. would be domain error without '@'eval ┌─┐ │6│ └─┘ eval is the key to how my multiline tacit code works: http://www.jsoftware.com/jwiki/PascalJasmin/Multiline%20tacit%20expressions%20with%20macros ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
