When dissect is constructing the display, gets to
(f [ h)
it knows that the execution of h is immaterial unless it encounters an
error. It displays only the f part.
It then grays out any part of the sentence that is not displayed.
Notice that it also grays out the leading ] and the ] in the @:], which
are also not needed.
There is an option to display both sides of ][.
Using the transformations
(f [ h) -> f
(] g@]) -> (] g)
(] g) -> g@]
(f@] g h@])-> (f g h)@]
you can turn it into
(2&o. + 1&o.)@]
Henry Rich
On 3/23/2018 3:26 AM, 'Jon Hough' via Programming wrote:
Consider the following tacit verb
f1=: ] (2&o.@:] + 1&o.@:] [ 5&+@:] 7&+@:] ([: <. ]) 10&*@:] 7&*@:])
It looks strange, and is pretty long. The interesting point is that only the
left
section ] (2&o.@:] + 1&o.@:] is useful. The rest of it is not evaluated.
i.e. f1 is equivalent to sin(x) + cos(x).
I noticed that the dissect tool recognizes this fact.
dissect '(] (2&o.@:] + 1&o.@:] [ 5&+@:] 7&+@:] ([: <. ]) 10&*@:] 7&*@:])) 1'
Everything but the sin(x) + cos(x) par tis greyed out, implying it is not
evaluated.
My question is, how does dissect recognize this? And is it possible to extract
a simplified
tacit verb from f1?
Thanks,
Jon
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
---
This email has been checked for viruses by AVG.
http://www.avg.com
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm