|
Hi, yes, thanks. I believe 4 ⎕CR tells the difference: 4 ⎕CR 5 ┏━┓ ┃5┃ ┗━┛ 4 ⎕CR ,5 ┏→┓ ┃5┃ ┗━┛ In GNU APL the difference between e.g. '5' and "5" is on purpose because the fact that '5' is a scalar and '55' is a vector can sometimes be quite annoying, and was one of the reasons for introducing "" in addition to ''. Another reason was support for ASCII control characters like \n in APL literals. /// Jürgen On 09/20/2015 11:15 PM, Kacper Gutowski
wrote:
On Sun, Sep 20, 2015 at 9:57 PM, <[email protected]> wrote:Should the execute primitive include the structure data? I thought that the phrase in the subject line would return zero. I thought the first element would return a scalar 5, and the second would return a single element five. Both evaluate to a scalar five.In some places single-element vectors and scalars are treated equally. That's why ⍎'5' is even allowed in the first place. ⍎ throws domain error if its argument has rank higher than one, but otherwise it doesn't care and executes ravel list of its argument as a single line regardless if it's a vector or scalar. |
- [Bug-apl] ≡/⍎¨ '5' "5" ⍝returns 1 alexweiner
- Re: [Bug-apl] ≡/⍎¨ '5' "5" ⍝returns 1 Kacper Gutowski
- Re: [Bug-apl] ≡/⍎¨ '5' "5" ⍝returns 1 Juergen Sauermann
