I find your explanation very helpful, especially because of the links
you have given to the primer, which I had not studied carefully. Refer
to the following link, please, where we read, "For a dyad the left
rank of the verb and the rank of the left argument determine the frame
of the left argument. Similarly the right rank of the verb and the
rank of the right argument determine the frame of the right argument.
..."

http://www.jsoftware.com/help/primer/agreement.htm

Can I take that to mean that the rank of the verb (which is + in all
of the examples there and which has a left rank of 0) and the  rank of
the corresponding argument determine the frames? In all the examples a
is the left argument and 2 3=$a, so the left frame (shape) is 2 3 in
all examples there because the left rank of + is 0. Elsewhere I
believe we read that in order to conform the the left frame shape, any
right argument must have a frame shape that conforms to the frame
shape of the left argument by either being a prefix of the left frame
or the left frame being a prefix of the right argument's frame. So,
conforming right frames include 2 3, 2, and empty here, but not 0,
here I believe?

Then, with the left argument a and the verb + in all of the examples
here, and with the right rank of + being 0, the right argument cell is
forced to 0. So, when the right argument is 7, its cell is 0 and its
frame is empty, 7 conforms.  But when the right argument is 3 4 5, its
frame is 3, which does not conform.

With these ideas in mind I constructed the following definitions which
I think produce frame(s) for a verb with argument(s).

   ranks=: 1 : 'u b. 0'
   decell=: -...@[<@}...@]
   frame =: 1 :0
cell=. {. u ranks
cell decell y
:
'lcell rcell'=. }. u ranks
(lcell decell x),rcell decell y
)

And the next few examples confirm results at the above link, including
my last one that shows the nonconforming example.

   a=: i. 2 3
   a + frame 7
┌───┬┐
│2 3││
└───┴┘
   a + frame 7 7 7
┌───┬─┐
│2 3│3│
└───┴─┘
   a + frame 2 3$7
┌───┬───┐
│2 3│2 3│
└───┴───┘
   a + frame 2 3 4
┌───┬─┐
│2 3│3│
└───┴─┘

And the next examples show a monadic verb and a dyadic verb with
literal arguments.

   + frame 2 3 4
┌─┐
│3│
└─┘
   '' ,"0 frame 1 2 3
┌─┬─┐
│0│3│
└─┴─┘
   '' decell frame 1 2 3
┌┬┐
│││
└┴┘


As shown above, my verb `frame` works with Graham's original one,
quoted next, to show the nonconforming frames 0 and 3, which RE showed
so clearly.

  '',"0 [1 2 3
|length error
|   ''    ,"0[1 2 3



On Sat, Aug 28, 2010 at 7:01 AM, R.E. Boss <[email protected]> wrote:
> As http://www.jsoftware.com/help/primer/agreement.htm states in the last
> paragraph: "(...) one frame must be a prefix of the other (...)"
>
> The frames of
>
>   '',"0 [1 2 3
>
> are 0 and 3, since 0=$'' and 3=$1 2 3 . Since 0 is not a prefix of 3 you get
> a length error.
>
> See also http://www.jsoftware.com/jwiki/Essays/A%20Fine%20Line
>
> Perhaps now you can work out the other examples yourself. Read also
> http://www.jsoftware.com/help/primer/result_shape.htm
>
>
> R.E. Boss
>
>
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to