Thw way dissect knows the rank of the verb it is executing is by
replacing avg with
(verbex_123_ =: avg)
and then doing verbex b. 0 to see what rank was really used. I had to
do it this way to handle the case of u"v .
I won't find a negative rank that way, but I think the only way a
negative rank can be assigned is using " , so I plan to look at the
trailing tokens of the first line of the definition of a verb, and see
if they are " numeric or ( " numeric ) and detect negative rank that
way. But I don't do that yet - I just treat negative rank as infinite rank.
Henry Rich
On 6/2/2013 9:32 AM, Raul Miller wrote:
I am trying to understand how ds (dissect.ijs addon) works
So I define a name with a rank, and ds properly shows that rank
avg=:(+/ %#)"1
ds 'avg p: i. 3 4'
And, I can take the definition of ds and plug it in, and that works
the same way:
ds
[: ([: (display_dissect_) 0:@". ::1:)`>@.(32 = 3!:0) [:
(parse_dissect_) 0&# :[ (([ ; 18!:5@(''"_) ; ]) ,
z458095869_dissectnopath_@(''"_)) ]
([: ([: (display_dissect_) 0:@". ::1:)`>@.(32 = 3!:0) [:
(parse_dissect_) 0&# :[ (([ ; 18!:5@(''"_) ; ]) ,
z458095869_dissectnopath_@(''"_)) ]) 'avg p: i. 3 4'
But when I try to get the result that has the rank of the name that I
defined, that is empty:
$z458095869_dissectnopath_''
0 3
But if I fix the definition, it works fine:
$z458095869_dissectnopath_ f.''
11 3
What's going on here?
Thanks,
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm