Re: [Jprogramming] scalars vs. lists in boxes

2017-12-20 Thread Dabrowski, Andrew John
Ah, I forgot that = has its own rank, that was silly. Thank you. On 12/20/2017 12:35 AM, bill lam 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" wrote: Here's my lat

Re: [Jprogramming] scalars vs. lists in boxes

2017-12-20 Thread Erling Hellenäs
Hi all ! It seems to look into the boxes and follow the rules described in the essay.    lt=: 1 0 -: \:@,&<    /:~ (,1);2 ┌─┬─┐ │2│1│ └─┴─┘    lt//:~ (,1);2 1    $&.>/:~ (,1);2 ┌┬─┐ ││1│ └┴─┘ As we can see <2 is smaller than <,1. Cheers, Erling Hellenäs Den 2017-12-20 kl. 11:32, skrev Erlin

Re: [Jprogramming] scalars vs. lists in boxes

2017-12-20 Thread Erling Hellenäs
http://code.jsoftware.com/wiki/Essays/The_TAO_of_J /Erling Den 2017-12-20 kl. 11:27, skrev bill lam: Grade up is defined in j dictionary. IIRC there is also an essay in jwiki on TAO ( total array order) by Roger Hui. -- For inf

Re: [Jprogramming] scalars vs. lists in boxes

2017-12-20 Thread bill lam
Grade up is defined in j dictionary. IIRC there is also an essay in jwiki on TAO ( total array order) by Roger Hui. -- For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jprogramming] scalars vs. lists in boxes

2017-12-20 Thread Erling Hellenäs
Hi all ! More interesting features with boxed data:     1;,1 ┌─┬─┐ │1│1│ └─┴─┘    (,1);1 ┌─┬─┐ │1│1│ └─┴─┘     You can compare boxes with Equal but not with Less Than or Larger Than. Anyway, Grade Up considers one larger than the other. Are these comparisons done on the binary representation

Re: [Jprogramming] scalars vs. lists in boxes

2017-12-20 Thread Henry Rich
To put this another way, (x = y) compares atoms and will produce an array if applied to an array (and will give length error if applied to arrays that don't agree).  (x -: y) answers the question 'are these things the same?' and returns 0 or 1. In if.-statements, you usually want -: if. x =

Re: [Jprogramming] scalars vs. lists in boxes

2017-12-19 Thread Raul Miller
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 wrote: > Or, to put it another way, equality (=) which compares values

Re: [Jprogramming] scalars vs. lists in boxes

2017-12-19 Thread Devon McCormick
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 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

Re: [Jprogramming] scalars vs. lists in boxes

2017-12-19 Thread bill lam
= 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" wrote: > Here's my latest exasperation. > > zero =: < (1$0) > > zero > > ┌─┐ > > │0│ > > └─┘ > > > zero > > 0 > > $ > zero > > 1 > > zero =

[Jprogramming] scalars vs. lists in boxes

2017-12-19 Thread Dabrowski, Andrew John
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?