Here is an issue to be aware of:

   1 (4 :'x+y') 1
2
   1 (4 :'x+y' v2c) 1
2
   1 (4 :('assert. x>0';'x+y')) 1
2
   1 (4 :('assert. x>0';'x+y') v2c) 1
(1) (2 : 0) 1
m 4 : 0
assert. x>0
x+y
) n
)

The problem is that 5!:5 does not do proper serialization of multi-line
explicit verbs. The result of 5!:5 is designed for use by 0!:0, and J is
perhaps too simplistic in this regard. (paraphrasing my understanding of
Ken Iverson's take on this issue: <<why would you want nested blocks? That
means you are not labeling things adequately, which leads to unreadable
code.>> though actually he would probably have said something far simpler,
like "why do you need that?")

Of course, many programmers love unreadable code, (consider ioccc as an
example). So maybe for their benefit we ought to have nested blocks and a
5!:7 serialization mechanism which can be used in ". contexts?

It's certainly something to think about, but it might be worth keeping in
mind that there will always be machine limitations and that for
computational symmetries to be valid they need someone to find a practical
use for them.

Thanks,

-- 
Raul


On Sat, Aug 2, 2014 at 12:35 AM, 'Pascal Jasmin' via Programming <
[email protected]> wrote:

> this adverb returns a conjunction which is designed to turn any dyadic
> verb into a conjunction purely for parsing convenience that a conjunction
> can sometimes provide.
>
>
> lrA =:  1 : '5!:5 < ''u'''
> v2c =: 1 : ' 2 : (''m '' , u lrA , '' n'')'
>
>
>    2 1 (, v2c) 3 + 4
> 6 5 7
>    appendC =. , v2c
>    appendC
> 2 : 'm , n'
>
>    2 1 appendC 3 + 4
> 6 5 7
>
> if you don't put parens around the adverb and its verb argument, then it
> treats the full y as the n argument to the resulting conjunction which is
> usually not what you want since that is what the original verb would do.
>  But including one of the conjunction arguments inside the parens, turns it
> into an adverb which may provide useful parsing patterns.
>
>    5 , v2c 2 1 (, v2c) 3 + 4
> 5 6 5 7
>
>    5 , (2 1 3 + 4)
> 5 6 5 7
>    5 (, v2c 2 1) (, v2c) 3 + 4
> 9 6 5 7
>    5 (, v2c) 2 1 (, v2c) 3 + 4
> 9 6 5 7
>    (5 , 2 1 , 3) +4
> 9 6 5 7
>
>    5 (, v2c) 3 (2 1 , v2c)  + 4
> 6 5 9 7
>
>    4 + 2 1 &, 5,3
> 6 5 9 7
>
> ----------------------------------------------------------------------
> 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