[Jprogramming] scalars vs. lists in boxes

Raul Miller rauldmiller at gmail.com
Wed Dec 20 07:04:47 UTC 2017


Or, more specifically, = is comparing atoms (the things that go into
arrays, which includes everything in a box - including the shape of
things in the box).

Thanks,

-- 
Raul


On Wed, Dec 20, 2017 at 12:48 AM, Devon McCormick <devonmcc at gmail.com> wrote:
> Or, to put it another way, equality (=) which compares values is different
> from equivalence (-:) which accounts for shape as well.
>
> On Wed, Dec 20, 2017 at 12:35 AM, bill lam <bbill.lam at gmail.com> wrote:
>
>> = is rank 0
>> -: is rank infinity
>>
>> Try 0= 1$0 and 0-: 1$0
>> and note the shape of results
>>
>> On Dec 20, 2017 1:16 PM, "Dabrowski, Andrew John" <dabrowsa at indiana.edu>
>> wrote:
>>
>> > Here's my latest exasperation.
>> >
>> >     zero =: < (1$0)
>> >
>> >     zero
>> >
>> > ┌─┐
>> >
>> > │0│
>> >
>> > └─┘
>> >
>> >     > zero
>> >
>> > 0
>> >
>> >     $ > zero
>> >
>> > 1
>> >
>> >     zero = <0
>> >
>> > 0
>> >
>> >     (>zero) = 0
>> >
>> > 1
>> >
>> >
>> > Why in God's name does J consider a singleton list 0 equal to the scalar
>> > 0 but consider the boxed versions of each distinct?
>> > ----------------------------------------------------------------------
>> > For information about J forums see http://www.jsoftware.com/forums.htm
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>>
>
>
>
> --
>
> Devon McCormick, CFA
>
> Quantitative Consultant
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm


More information about the Programming mailing list