Hi,
in GNU APL monadic ↑ takes the first element ( that is of a vector or
higher ranking matrix, try ↑ 3 3 3 ⍴'abc' 'cde').
As the resulting vector has three elements you end up replicating them
9, 2, 9 times ( 9 2 9 / 'abc').
So there is no application of the replication vector 9 2 9 to all of the
right elements.
Side note 9 2 9 / 'abc' 'def' 'xyz' is an *element wise* replication as
left and right vectors are of same length.
Try each: 9 2 9 /¨ 'abc' 'def' . The left argument is being applied to
each right vector.
Using monadic ⊃ you end up disclosing a vector of vectors resulting in a
matrix.
⊃'abc' 'def'
abc
def
Using 9 2 9 / ⊃'abc' 'def' will replicate the matrix column wise.
That is the same effect as with ⊃ 9 2 9 /¨ 'abc' 'def' .
Best Regards
Hans-Peter
Am 24.12.20 um 09:08 schrieb Russtopia:
Thank you so much for a rapid answer. With no background into the
history of the language, I would not have known where to look for this
sort of thing.
I see now in Dyalog's "Mastering Dyalog APL, 1st Ed.", ~p372
"Specialists Section" there are discussions about this and related
language differences.
There are a few items to digest there in regards to their ⎕ML System
Variable and how it handles APL2 (IBM) vs. Dyalog APL dialects.
The more I explore, the more I question whether I must choose to study
"the APL2 path" or "the Dyalog APL path" ... :) I hope I do not have
to choose!
So far, trying both dialects while learning has illuminated some
concepts for me, but I fear I might confuse myself with implementation
differences.
Again, thank you very much for the insight.
-Russ
On Wed, 23 Dec 2020 at 23:21, Kacper Gutowski <mwgam...@gmail.com
<mailto:mwgam...@gmail.com>> wrote:
On Wed, Dec 23, 2020 at 10:46:13PM -0800, Russtopia wrote:
> [Dyalog]
> 9 2 9/↑'∘⌹∘' ' ⌹ '
> ∘∘∘∘∘∘∘∘∘⌹⌹∘∘∘∘∘∘∘∘∘
> ⌹⌹
>
> [GNU]
> 9 2 9/↑'∘⌹∘' ' ⌹ '
> ∘∘∘∘∘∘∘∘∘⌹⌹∘∘∘∘∘∘∘∘∘
>
> Is it unexpected that GNU APL does not apply the Compress (/)
across
> multiple right-hand items?
There are some subtle differences in how / works in Dyalog and in
GNU APL,
but here the reason is much more prosaic.
By default the monadic ↑ and ⊃ are swapped in Dyalog. It has a
setting
called ⎕ML that controls it, and if you set ⎕ML←2, it will interpret
this expression the same way GNU APL does:
9 2 9/⊃'∘⌹∘' ' ⌹ '
∘∘∘∘∘∘∘∘∘⌹⌹∘∘∘∘∘∘∘∘∘
⌹⌹
-k