⍝ Shouldn't it be interpreted as a simple index expression? A[ 1 2 3 ]
⍝ since there are no statement terminators (CRs or '⋄')?
⍝ Let's investigate...
...
⍝ Relocate needed fn Deserialise (and others it may call) to # for convenience
'#' ⎕NS ⎕SE.Dyalog.Array
⍝ This makes sense: special case because of embedded statement end via '⋄'
0 Deserialise '(1 2 ⋄ ⍳3)'
((1 2 )( ⍳3))
⍝ This makes sense: not special case so same as ordinary expression (1 2 ⍳ 3)
0 Deserialise '(1 2 ⍳3)'
(1 2 ⍳3)
⍝ This too makes sense: it's a special case
⍝ because of embedded statement end via '⋄'
0 Deserialise '[1 2 ⋄ ⍳3]'
({⎕ML←1⋄↑⍵}1/¨((1 2 )( ⍳3))) ⍝ <==== Expected response, so all's well!
⍝ Now let's try A[...], where A is just a vector of numbers.
⍝ First, we assign A.
A←1 2 3 4 5
⍝ We'd expect the case below to return the simple code A[1 2 ⍳ 3] below.
0 Deserialise 'A[1 2 ⍳ 3]'
⍝ But it produces this, two side by side expressions of the form:
⍝ A( ...... )
A({⎕ML←1⋄↑⍵}1/¨(1 2 ⍳ 3)) ⍝ Huh?
⍝ ... which has the value:
1 2 3 4 5 3
⍝ AKA...
┌─────────┬──┐
│1 2 3 4 5│ 3│
└─────────┴──┘
⍝ NOT WHAT WE EXPECTED.
⍝ We expected this:
A[1 2 ⍳ 3]
3
Is there an error in the handling of
- 0 Deserialise 'A[1 2 ⍳ 3]'