Re: [Bug-apl] scalar/array

2017-03-04 Thread Kacper Gutowski
On Fri, Mar 03, 2017 at 02:57:00PM -0700, enz...@gmx.com wrote: > cause 1 is 1 element and 1 2 3 is 3 elements so ⍴ 1 2 3 is 3 > and ⍴ 1 should have been 1 But 1-element arrays come in many different shapes and ⍴ returns the shape rather than number of elements. To get the later

Re: [Bug-apl] scalar/array

2017-03-04 Thread Juergen Sauermann
Hi, the scalar extension mechanism is a very fundamental principle which existed since the beginning of APL. If you randomly pick an 1-element value from any APL program, then I would bet that the value is a scalar with a probability of ≥ 90%, a

Re: [Bug-apl] scalar/array

2017-03-04 Thread Elias Mårtenson
On 4 March 2017 at 05:57, wrote: what is the reason? do you know their reasoning > > cause 1 is 1 element and 1 2 3 is 3 elements so ⍴ 1 2 3 is 3 > and ⍴ 1 should have been 1 But that's wrong. 1 is not a one-element array. 1 is just a number. 1 2 is a two-element array. Each elemen

Re: [Bug-apl] scalar/array

2017-03-03 Thread enztec
On Fri, 3 Mar 2017 20:45:45 +0100 Juergen Sauermann wrote: > Hi, > what is the reason? do you know their reasoning cause 1 is 1 element and 1 2 3 is 3 elements so ⍴ 1 2 3 is 3and ⍴ 1 should have been 1 I never understood their reasoning or how it negatively affected anyth

Re: [Bug-apl] scalar/array

2017-03-03 Thread Juergen Sauermann
Hi, I believe the reason why 'a' is scalar and 'abc' is not is the same as why 1 is a scalar and 1 2 3 is not. It is very consistent, but often very inconvenient. And in practice it is often a pitfall for the unaware programmer. I fooled myself

Re: [Bug-apl] scalar/array

2017-03-03 Thread enztec
thank you - fantastic ...it sure 'fixes' the inconsistency i had no idea about "a" I saw the use of " only in the FILE_IO "r" in the apl.htmlbut thought that was related to just fopen/bash/c syntax --- Do you know the 'details' about why iverson did this to begin with? How did you

Re: [Bug-apl] scalar/array

2017-03-03 Thread Elias Mårtenson
In GNU APL, try this instead : "a"[1] The reason this seems inconsistent is because single quote is used to define a string, i.e. an array of characters. Except the case where there is only a single character, in which case it represents a scalar character. GNU APL allows you to use double quot

[Bug-apl] scalar/array

2017-03-03 Thread enztec
i just watched a great video on apl and this was discussedi still don't know what the harm/problem would be if instead of returning 'nothing' ⍴'a' why doesn't it return 1 - there is something there please don't mention scalar i know all about it - but to me thi