There is nothing I know of that does what {{ }} does.  But Raul's idea is pretty close.  As he notes, it fails for nested {{ }} (there is much code that expects the result of 5!:5 <'explicitname' to have the form m : string, but nested {{ }} seemed OK).

Henry Rich

On 1/11/2022 9:19 AM, Raul Miller wrote:
If you avoid nested {{ }} blocks, 5!:5 would do this.

In other words, this works:

    mean=: {{ (+/ % #) y}}
    5!:5<'mean'
3 : '(+/ % #) y'

But this would be useless for your purposes:

    mean=: {{ {{x + y}} {{u/}} {{x % y}} {{#y}} }}
    5!:5<'mean'
3 : '{{ x + y }}  {{ u/ }}  {{ x % y }}  {{ #y }}  '

FYI,


--
Raul

On Tue, Jan 11, 2022 at 4:25 AM 'Mike Day' via Programming
<[email protected]> wrote:
For Henry I expect: as I share code between J903 on the laptop and J701 on this 
iPad,  I’ve been avoiding the use of {{ }} objects.  (My iPad can’t support 
Ian’s new J902.)

But I was just wondering about adding a routine to the J701 start.ijs script to 
parse a J903 script translating direct definitions to their earlier 
equivalents.  And then I thought there might already be native J code to do 
this.

So: do I need to invent this wheel?

Thanks,

Mike

Sent from my iPad
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm


--
This email has been checked for viruses by AVG.
https://www.avg.com

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

Reply via email to