Note that I'm using Dyalog APL for the following.
Given:
S←'string'
S
string
⍴S
6
⍴⍴S
1
DISPLAY S
┌→─────┐
│string│
└──────┘
If I perform a reduction with concatenation, I get a scalar:
S_←,/S
S_
string
⍴S_
⍴⍴S_
0
DISPLAY S_
┌──────────┐
│ ┌→─────┐ │
│ │string│ │
│ └──────┘ │
└∊─────────┘
Naturally, I can no longer access the elements of my "array". I was wondering why this behavior occurs? I had believed that /
acted like foldr
and that ,
produced a vector, so why do I end up with a scalar result at the end?
Thanks in advance for any help.