Yes, but the question is why--and is it a good idea? It's not like we can't compare arrays of unlike shape or datatype; /: does it:

   /:~ (<'abcd'),<<'abc'
┌────┬─────┐
│abcd│┌───┐│
│    ││abc││
│    │└───┘│
└────┴─────┘

On Fri, 14 Oct 2022, bill lam wrote:

i. is lenient but I. is not so that their error handling cannot be
consistent with each other. Eg

  'abcd' i. 1 2
4 4

  'abcd' i. <'abc'
4

  'abcd' I. <'abc'
|domain error
| 'abcd' I.<'abc'



On Fri, Oct 14, 2022, 8:34 AM Elijah Stone <elro...@elronnd.net> wrote:

I do not understand what you are getting at.  Obviously I. and i. are
different.

I. and i. (and many verbs related to i.) have analogous behaviour in that,
while they nominally have infinite rank, they actually consider y to be a
collection of x-cells, such that eg x f y is equivalent to x f"(_,<:#$x) y.

But this is one difference in their behaviour.  I find it inconsistent,
and I
prefer the behaviour of I. .  And insofar as it might make sense to give
any
answer at all given arguments of mismatched shapes, I think it makes
significantly more sense for I. to give an answer than for i. to do so.  A
result returned from I. in such a situation will have some informational
content, whereas the result returned from i. can predicted solely by
looking
at the shapes of x and y.

On Thu, 13 Oct 2022, Raul Miller wrote:

> i. and I. have different definitions. They cannot be made to give the
> same results without breaking one or the other (or both).
>
>   V=: ?.~20
>   V i. 17
> 13
>   V I. 17
> 2
>
> --
> Raul
>
> On Thu, Oct 13, 2022 at 7:56 PM Elijah Stone <elro...@elronnd.net>
wrote:
>>
>> Not consistent with I., though.  And I don't think the result is
useful; there
>> is no way there will ever be a match.  (Compare with I., which _could_
>> plausibly give you useful information if it didn't throw an error.)
>>
>> On Fri, 14 Oct 2022, bill lam wrote:
>>
>> > I think the results are fine and are consistent with e.~
>> >
>> >
>> > On Fri, 14 Oct 2022 at 7:39 AM Elijah Stone <elro...@elronnd.net>
wrote:
>> >
>> >>     (i.3 3) i.2
>> >> 3
>> >>     (i.3 3) i. i.5
>> >> 3
>> >>
>> >> Are these results of use to anyone?  I would prefer an error.
>> >>
>> >> I. will give one:
>> >>
>> >>     (i.3 3) I.2
>> >> |rank error
>> >> |   (i.3 3)    I.2
>> >>     (i.3 3) I. i.5
>> >> |length error
>> >> |   (i.3 3)    I.i.5
>> >>
----------------------------------------------------------------------
>> >> For information about J forums see
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
> ----------------------------------------------------------------------
> For information about J forums see 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
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to