If you replace each expression with  @: with one without it:

    2.5 (>. % <. @: + * -) 4
_0.444444
   2.5 (>. % <. @ + * -) 4
_0.444444

   2.5 (>. % <. @ (+ * -)) 4
_0.4
   2.5 (>. % <. @ (+ * -)) 4
_0.4  


Now you can see the difference in the removal of parentheses better.


    2.5 (>. % [: <. + * -) 4
_0.4
   2.5 (>. % <. @ + * -) 4
_0.444444
   2.5 (>. % <. @ (+ * -)) 4
_0.4
   2.5 (>. % <. @ (+ * -)) 4
_0.4
   2.5 (>. % [ <.@] + * -) 4
_0.4

When the dictionary was written, there was the cost of printing books and
articles to consider.  The forum provides the luxury of giving sufficient
examples that a concept can be presented from different perspectives which
may make understanding easier.

   f=:>. % [: <. + * -
   2.5 f 4
_0.4
  
   5!:4 <'f'
  -- >.         
  +- %          
--+    -- [:    
  │    +- <.    
  L----+    -- +
       L----+- *
            L- -

I find a tree helpful here.

Linda


-----Original Message-----
From: programming-boun...@forums.jsoftware.com
[mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Jose Mario
Quintana
Sent: Friday, December 07, 2012 7:11 PM
To: programm...@jsoftware.com
Subject: Re: [Jprogramming] @: and capped fork (and puzzles)

To Linda,

   2.5 (>. % [: <. + * -) 4
_0.4
   2.5 (>. % <. @: + * -) 4
_0.444444444
   2.5 (>. % <. @: (+ * -)) 4
_0.4
   2.5 (>. % [ <.@] + * -) 4
_0.4

NB. This is the example given in the Dictionary's entry for Cap.


To Dan,

I am glad that somebody is having fun.  These are very good questions and
the necessary clarifications give away some clues:

- re (Ca f p g) vs ([: f g) :   the equivalence fails because the
execution of sentences involving (Ca f p g) break down when applied to
(meaningful) identical arguments.

- re the interpreter "preferring" @: to [: in certain cases: actually, the
puzzle was to find "instances where the interpreter even favors atop (@)
over ([:)" but there are also instances where the interpreter favors (@:)
over ([:)  and, yes, this preferences are demonstrated in other contexts not
involving (13 :)  (I could not help to leave behind a red herring behind,
hence:  "(This is a tricky puzzle thought)").
:)

By the way, there is a bonus puzzle within the solutions.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to