Let's modify Jose's example (by taking the *difference* of two
identocal terms):
NB. this works as expected:
d=. 13 : 'T - T=. +:y'
d 10+i.7
0 0 0 0 0 0 0
NB. this doesn't:
e=. 13 : 'T - T=. ?y'
e 10+i.7
_1 1 5 _5 8 _2 _4
NB. this yields the same result (zero) for every argument:
d
+--+-+--+
|+:|-|+:|
+--+-+--+
+: - +:
NB. this yields arbitrary results (because minuend and subtrahend do
not necessaryly have the same value):
e
+-+-+-+
|?|-|?|
+-+-+-+
? - ?
But ... from the underlying structure they should have.
NB. in comparison this works as intended:
f=. 13 : 'T - T=. ?.y'
f 10+i.7
0 0 0 0 0 0 0
f
+--+-+--+
|?.|-|?.|
+--+-+--+
?. - ?.
-M
At 2018-10-17 10:22, you wrote:
Jose,
You said: You might be interested to know that 13 : '...'
occasionally is too smart; some verbs, such as ?, which do not
always produce the same result given the same argument, sometimes do
not mix well with 13 : '...'; for example,
Something is not wrong when verbs with ? don't agree. I would worry
is they did agree. They areproducing different results each time they are used.
Linda
-----Original Message-----
From: Programming <programming-boun...@forums.jsoftware.com> On
Behalf Of Jose Mario Quintana
Sent: Tuesday, October 16, 2018 7:37 PM
To: Programming forum <programm...@jsoftware.com>
Subject: Re: [Jprogramming] Using rank to avoid looping - reference?
Linda,
You might be interested to know that 13 : '...' occasionally is too
smart; some verbs, such as ?, which do not always produce the same
result given the same argument, sometimes do not mix well with 13 :
'...'; for example,
( u=. 3 : ' T + (T=. ? y)' )
3 : ' T + (T=. ? y)'
and
( v=. 13 : ' T + (T=. ? y)' )
? + ?
do not mean the same process.
I hope it helps
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm