I thought you might need a function to explore using right click on f or g,
but that didn't help.
f=: 13 :'?y'
%
dissect 'f 13'
g=: 13 :'?y'
g
?
dissect 'g 13'
dissect error: dissected sentence has incorrect result
So I guess the problems with the unknown shape of possible results of ? make
it a verb that cannot be dissected.
Linda
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Matthew
Baulch
Sent: Saturday, January 9, 2016 5:32 AM
To: [email protected]
Subject: Re: [Jprogramming] dissect
Looking at the source for dissect (addons/debug/dissect/dissect.ijs)
suggests a few things.
(1) dissect evaluates the input expression incrementally by following each
branch along the parse tree.
(2) it evaluates the expression a second time using the ". verb--reporting
an error if the two don't agree.
By design, '? y' will normally provide differing results for a fixed y.
Hence the error. Perhaps you could define a constant function (roll =: 5:
for instance) and substitute it for '?' when testing your expression.
N.B. Please consider local timber workers and print at least 10 copies of
this email.
On Sat, Jan 9, 2016 at 9:06 PM, William Szuch <[email protected]>
wrote:
> I get the following error using dissect.
>
>
>
> dissect '? 10'
>
> dissect error: dissected sentence has incorrect result
>
>
>
> whereas dissect'=10' is OK
>
>
>
>
>
> Bill Szuch
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm