I had a little brain fart this morning.  What might it mean to assign
direct definition forms?

In current J we have the ugly but extremely useful form:

'this stuff gets array items'=: arr

The names get parsed in the string and assigned corresponding array items.
This has been in J forever and is so handy we tolerate the hideous QUOTED
code.

Suppose:

{{this stuff gets array items}}=: arr

No more ugly quoted code. But why stop there, consider a general DD with
unbound names.

{{this * that ^ more}}=: arr

One way to approach this is to treat the names in the DD like a regular J
expression accessing global names in it's namespace.
The names are bound by matching corresponding names with array items, just
like the current 'this that more'=: array,  and then the expression is
evaluated as always.

This opens up a world of possibilities like:

 {{+/a * b % c ^ d - e}}=. {{5 # this * that ^ more}}=: arr

This is only a slight generalization of what's already in J. I'm not
suggesting immediate implementation - just curious as to what others may
think.

-- 
John D. Baker
[email protected]
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to