Hi Elias,

yes, I believe so.

The ISO standard,
chapter 9.2.1 Reduction, allows 2 different variants for reduction called the
Enclose-Reduction-Style (aka. APL2 style) and the Insert-Reduction-Style (aka. Sharp/J style).

GNU APL uses the APL2 style for compatibility with IBM APL2. The APL2 style requires that
the rank of the reduction result is, if possible, one less than the rank of the argument.

In your example, the argument has rank 1 and therefore the result must have rank 0:

      ⍴⍴ (1 2) (2 3) (3 4)
1
      ⍴⍴ ,/ (1 2) (2 3) (3 4)
0


For that reason the result is enclosed to make it a scalar. The
Insert-Reduction-Style
would have produced the result that you had expected.

/// Jürgen


On 06/12/2016 12:20 AM, Elias Mårtenson wrote:
The following gives a very obvious result:

      (1 2),(2 3),(3 4)
┏→━━━━━━━━━━┓
┃1 2 2 3 3 4┃
┗━━━━━━━━━━━┛

Assuming that the / operator splices the function between each value, you'd expect the following to yield the same result, but it becomes boxed. Is there an explanation for this?

      ,/ (1 2) (2 3) (3 4)
┏━━━━━━━━━━━━━┓
┃┏→━━━━━━━━━━┓┃
┃┃1 2 2 3 3 4┃┃
┃┗━━━━━━━━━━━┛┃
┗∊━━━━━━━━━━━━┛

Regards,
Elias

Reply via email to