} Item Amend - Amend This is what I call a "special syntax" of Amend,
from the J Vocabulary. This can be used to set the index argument from
variables in tacit J, as far as I remember from a very long thread
"[Jprogramming] Tacit J and indexed replacement". /Erling
Ifm is a gerund, one of its elements determines the index argument to
the adverb} ,and the others modify the argumentsx andy :
x (v0`v1`v2)} y ↔ (x v0 y) (x v1 y)} (x v2 y)
(v0`v1`v2)} y ↔ (v1 y)} (v2 y)
(v1`v2)} y ↔ (v1 y)} (v2 y)
For example, the following functionsE1,E2,andE3 interchange two rows of
a matrix, multiply a row by a constant, and add a multiple of one row to
another:
E1=: <@] C. [
E2=: f`g`[}
E3=: F`g`[}
f=: {:@] * {.@] { [
F=: [: +/ (1:,{:@]) * (}:@] { [)
g=: {.@]
M=: i. 4 5
M;(M E1 1 3);(M E2 1 10);(M E3 1 3 10)
+--------------+--------------+--------------+-------------------+
| 0 1 2 3 4| 0 1 2 3 4| 0 1 2 3 4| 0 1 2 3 4|
| 5 6 7 8 9|15 16 17 18 19|50 60 70 80 90|155 166 177 188 199|
|10 11 12 13 14|10 11 12 13 14|10 11 12 13 14| 10 11 12 13 14|
|15 16 17 18 19| 5 6 7 8 9|15 16 17 18 19| 15 16 17 18 19|
+--------------+--------------+--------------+-------------------+
On 2016-08-12 15:25, Erling Hellenäs wrote:
In tacit J. /Erling
On 2016-08-12 15:22, Raul Miller wrote:
Er... what do you mean by "you can't set it from variables"?
I can do this:
amend= }
Now I can do:
x m amend y
Same exact syntax, the only thing that has changed is the name. (Which
gets us back into the discussion about what does "concise syntax"
actually mean and is that related to the names involved or not?)
I can also do this:
AMEND=:3 :0
'x m y'=. y
x m} y
)
Now, I can do this:
AMEND x;m;y
and that's a different syntax.
Anyways, I can't figure out what you are telling me, and that feels
frustrating.
But mostly, I guess it sounds like you have borrowed some parts of J's
vocabulary and are using it with a different syntax. And, I guess that
that can be a good exercise for you.
But maybe I should stop thinking about the things you are saying as
having to do with J itself and instead I should take them to be about
your project (which happens to have J as the first letter of its
name)?
Thanks,
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm