$(i.3)(+"0"0 _)i.4
3 4

simplifying by using the minimum of all nested ranks:

   $(i.3)(+"0)i.4
|length error

-- 
Raul

On Wed, Jun 19, 2013 at 11:46 PM, Michal D. <[email protected]> wrote:
> Yes, going about my interpreter implementation it became clear that this
> was the likely implementation.  I was quite surprised by it when I first
> started thinking about it and pleasantly surprised when it turned out to be
> true in J.
>
> Is it just me or is simplifying equivalent to taking the minimum of all
> nested ranks?
>
> Cheers,
>
> Mike
>
>
> On Mon, Jun 17, 2013 at 11:49 PM, Aai <[email protected]> wrote:
>
>> Thinking about it, I should have said: simplifying explicit ranks.
>>
>>
>> On 18-06-13 04:16, Michal D. wrote:
>>
>>> Hi,
>>>
>>> I'm not quite sure what you mean by "reducing explicit ranks" - could you
>>> elaborate?
>>>
>>> Cheers,
>>>
>>> Mike
>>>
>>>
>>> On Mon, Jun 17, 2013 at 1:25 AM, Aai <[email protected]> wrote:
>>>
>>>  Same results can be obtained by reducing explicit ranks.
>>>>
>>>>     (2 2$0 1 100 0) ([;];* ;*"1 2; *"1;*"1 1"1 2) 1+i.2 2 2
>>>> ┌─────┬───┬───────┬───────┬───****──┬─────┐
>>>>
>>>> │  0 1│1 2│  0   0│  0   0│  0 2│  0 2│
>>>> │100 0│3 4│  3   4│  3   4│  0 4│  0 4│
>>>> │     │   │       │       │     │     │
>>>> │     │5 6│500 600│500 600│500 0│500 0│
>>>> │     │7 8│  0   0│  0   0│700 0│700 0│
>>>> └─────┴───┴───────┴───────┴───****──┴─────┘
>>>>
>>>>
>>>>
>>>>
>>>> On 16-06-13 20:59, Michal D. wrote:
>>>>
>>>>  Hi All,
>>>>>
>>>>> Here's an interesting behaviour I came across while trying to implement
>>>>> a
>>>>> J
>>>>> interpreter - the behaviour of nested ranks.  It turns out that using "
>>>>> actually does not modify the rank of the underlying verb but adds
>>>>> another
>>>>> wrapper in how it is applied.
>>>>>
>>>>> Note that (1) and (2) below produce different results.
>>>>>
>>>>> box2 provides an easier way to visualize what arguments a verb is
>>>>> applied
>>>>> to.
>>>>>
>>>>> Mike
>>>>>
>>>>> ---
>>>>>
>>>>>      ] y=:2 2 $ 0 1 100 0
>>>>>     0 1
>>>>> 100 0
>>>>>      ] z =: 2 2 2 $ 1+i. 100
>>>>> 1 2
>>>>> 3 4
>>>>>
>>>>> 5 6
>>>>> 7 8
>>>>>      y *"1 2 z NB. (1)
>>>>>     0   0
>>>>>     3   4
>>>>>
>>>>> 500 600
>>>>>     0   0
>>>>>      y (*"1 1)"1 2 z NB. (2)
>>>>>     0 2
>>>>>     0 4
>>>>>
>>>>> 500 0
>>>>> 700 0
>>>>>      box2=: (<@:[),(<@:])
>>>>>      y box2"1 2 z
>>>>> +-----+---+
>>>>> |0 1  |1 2|
>>>>> |     |3 4|
>>>>> +-----+---+
>>>>> |100 0|5 6|
>>>>> |     |7 8|
>>>>> +-----+---+
>>>>>      y (box2"1 1)"1 2 z
>>>>> +-----+---+
>>>>> |0 1  |1 2|
>>>>> +-----+---+
>>>>> |0 1  |3 4|
>>>>> +-----+---+
>>>>>
>>>>> +-----+---+
>>>>> |100 0|5 6|
>>>>> +-----+---+
>>>>> |100 0|7 8|
>>>>> +-----+---+
>>>>> ------------------------------****----------------------------**--**
>>>>> ----------
>>>>> For information about J forums seehttp://www.jsoftware.com/****
>>>>> forums.htm <http://www.jsoftware.com/**forums.htm><http://www.**
>>>>> jsoftware.com/forums.htm <http://www.jsoftware.com/forums.htm>>
>>>>>
>>>>>  --
>>>> Met vriendelijke groet,
>>>> @@i = Arie Groeneveld
>>>>
>>>> ------------------------------****----------------------------**
>>>> --**----------
>>>> For information about J forums see http://www.jsoftware.com/****
>>>> forums.htm <http://www.jsoftware.com/**forums.htm><http://www.**
>>>> jsoftware.com/forums.htm <http://www.jsoftware.com/forums.htm>>
>>>>
>>> ------------------------------**------------------------------**
>>> ----------
>>> For information about J forums see 
>>> http://www.jsoftware.com/**forums.htm<http://www.jsoftware.com/forums.htm>
>>>
>>
>> --
>> Met vriendelijke groet,
>> @@i = Arie Groeneveld
>>
>> ------------------------------**------------------------------**----------
>> For information about J forums see 
>> http://www.jsoftware.com/**forums.htm<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

Reply via email to