Is it a bug? More a continuing penance for an initial faulty design.
https://code.jsoftware.com/wiki/Vocabulary/com#Details note 11 describes
the situation.
In early J, the names u/v/m/n had not been invented, and an explicit
modifier had only the names x and y to work with. x was what we now
call u, and y v. Obviously, such a modifier was very restricted: to
produce a modifier as we now know it, with access to u/v/x/y, the
modifier would have to create the text after substituting its x/y, and
have that reinterpreted by (3 : n) to create a verb. That definition
didn't last long, but while it was in force a few simple system
modifiers were written, for example
bind
2 : 'x@(y"_)'
Nowadays we would write 'u@m' or 'u@(m"_)'. The language wasn't even
weaned and it had a compatibility problem!
The 'solution', still in place today, was to inspect the text of the
modifier. If no reference to u/v/m/n is found, the modifier is assumed
to be old-style, and the names x and maybe y are defined as the modifier
arguments. With your example, an adverb has no y, so y is left
undefined and you get a value error. This error is detected when (1
now) is executed. You want a new-style modifier that defers execution
until the (modifier+u/v) sees 'cat'.
To get a new-style modifier, you have to have u/v/m/n in there
somewhere. Just as you discovered.
Henry Rich
On 8/7/2020 11:28 AM, Paul Jackson wrote:
This is not where I began. I had lots of use of the m argument, but all of
it in quotes. It took me a while to isolate the problem to something this
simple. Now that I have, I have also found other errors are signaled with
the dyadic case of an adverb, and both cases of a conjunction. As my second
example shows, I can avoid the problem with an unnecessary use of the name.
I can provide details if anyone has trouble replicating the rest of the
issues. What I'm hoping for is a confirmation that this is a bug.
Paul
now=: 1 : 0
y
)
1 now'cat'
|value error: now
| y
now=: 1 : 0
y [m=. m
)
1 now'cat'
cat
JVERSION
Engine: j901/j64/android
Release-f: commercial/2020-06-12T10:01:40
Library: 9.01.24
J Android: 1.4.09/9/28
Platform: Android 64 (arm64-v8a)
Installer: unknown
InstallPath: /storage/emulated/0/Android/data/com.jsoftware.j.android/files
Contact: www.jsoftware.com
----------------------------------------------------------------------
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