Several misconceptions.
If the body of c refers to y, m c n produces a verb that operates on a
subsequently-given [x]/y. I will assume that is what you are using,
since the only way to produce a modifier is using an explicit definition.
In this case, you must distinguish between the execution of c, in m c n,
and the execution of the /derived verb/ (m c n) in the later x (m c n) y.
The execution of c does very little: it remembers the values of m and n
and packages them with the body of c into the derived verb. m and n are
not 'evaluated', because by the time they get to c they have already
been reduced to a single noun value.
When the derived verb is executed, it refers to m and n by name, which
is quite efficient.
It sounds like you expected the words m and n to be replaced in the body
text of c by the value when the derived verb was created. This would
have ill effects:
1. m and n are allowed to be redefined during execution of the derived verb
2. there is no word that can replace m/n to define a general noun value
- an expression would be required
3. J doesn't know about named constants; it knows only nouns. m and n
could be megabytes in size. Installing them into a sentence would be
inefficient.
Henry Rich
On 2/16/2020 3:05 AM, Hauke Rehr wrote:
Hello everybody,
I recently stumbled upon some at least
for me counterintuitive (read: puzzling) behaviour:
In a verb like (>: X) {~ ], when X is a defined constant,
the constant expression (>: X) is substituted in the verb (as expected)
but in a conjunction M c N, when M and N are defined constant nouns,
constant expressions are not substituted in c’s body (not expected)
I would not want m c n to be evaluated time and again
when some part of it, just like in the case of the verb above,
could be evaluated once when defining the derived verb.
This should result in major savings of computational
resources so I’d have expected J to do this.
could anyone tell me why this is different from verbs?
kind regards,
Hauke Rehr
(Jena, Germany)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm