Nor I, but I suspect it's a noun because:
- If it were a verb, it would possible and more straightforward
to express the train as ] e. d and skip the ~ . But if d
is a noun, the only way to bake it into a train is to use
N V V and twiddle the e. .
- It's used as a right argument to e. , and the right argument
to e. is the "universe of all things", which is usually known
in advance (a noun) and rarely computed (a verb).
BTW e.&y is support by special code for many common types of arguments.
-Dan
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Linda Alvord
Sent: Thursday, October 13, 2011 11:00 AM
To: 'Programming forum'
Subject: Re: [Jprogramming] Remove part of rank-2 array
A clear explanation of the problem, Dan!
Also, I'm not sure what d is.
([: d e.~ ]) 2
Linda
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Dan Bron
Sent: Thursday, October 13, 2011 10:40 AM
To: 'Programming forum'
Subject: Re: [Jprogramming] Remove part of rank-2 array
Anything you can write in the browser window (IJX) or an explicit verb, or
anywhere else in J, can be written tacitly. The only restriction on tacit
code is it is stateless (no use of =: =. ). So, yes, you can use e.
tacitly.
The issue you're having is due to [: . That verb (it is a verb, and that
fact is germane) is used to "cap" a fork - it's a placeholder for the left
tine, which causes J to reinterpret the middle tine as a monad, rather than
a dyad. That is, [:'s sole purpose is to allow you to express a composition
of 2 verbs (f g) as a train, rather than use @: or some other glue.
If you're not using [: this way (to cap a train of 2 verbs f g to derive a
new verb with the semantics of f@:g), then it will be invoked per the usual
rules. That is, it will be applied to arguments. But [: has an empty
domain. It has no valid inputs. All inputs to [: cause domain errors.
That's what happened in this case.
In particular, your verb has an odd number of verbs to the right of [: .
The only time [: can avoid a domain error is when it's in a train with an
_even_ number of verbs to the right. Your verb has the form [: N V0 V1
which is equivalent to [: N"_ V0 V1 which is equivalent to [: V which, any
way you slice it, has [: to the left of an odd number of verbs. So [: is
invoked as a normal verb, given the output of e. as an input, which it
rejects, because it rejects all inputs.
So to get your verb to work, you'd want to say (d e.~ ]) or more directly
e.&d .
-Dan
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of David Vaughan
Sent: Thursday, October 13, 2011 10:10 AM
To: Programming forum
Subject: Re: [Jprogramming] Remove part of rank-2 array
And is it not possible to use e. in tacit verbs?
|domain error
| ([:d e.~])2
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm