Hi,
1) Yes you can. Whether you should is another question: There's nothing
wrong with explicit code, and aiming to forcibly make everything tacit is
the way to a lot of frustration if you're trying to get things done,
especially if 3 or more arguments are needed to be juggled.
In most of such ca
A general version of approach 1 is to append any temporary results to original
argument in boxed form.
G0 =: 0 {:: ]
G1 =: 1 {:: ]G2 =: 2 {:: ]
[: (G2 V~ G1 U G0 ) [ ( [ (] (,<)~ W) G1) ] ,&< Q
Can be streamlined a bit with:
NB. keeps y argument, though ensures it is boxed, and appends resul
1) yes, but it might not be a good idea. (You can form x and y into a
sequence which can be passed as a single argument, and then extract
arguments from that sequence.)
2) If Q is expensive to compute, I am aware of two other options:
(a) use a name to refer to its result (as you have done here),
Let U, V, W, P, Q be dyads and
F =: dyad define
(tmp U y) V x W y P tmp =. x Q y
)
Tacit form of F, for example, is
F =: (Q U ]) V [ W ] P Q
but in this definition Q is repeated.
1. Is it possible to convert definition of F to tacit form without repeating Q
in definition?
2. Does the int