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?

   ([: d e.~ ]) 2
|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

Reply via email to