bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-apl] Reshape operator with variable on left-hand side doesn't work


From: Elias Mårtenson
Subject: [Bug-apl] Reshape operator with variable on left-hand side doesn't work
Date: Thu, 28 Nov 2013 15:53:56 +0800

When I use the ⍴ operator where one of the entries in the left-hand list is a variable, I get a DOMAIN ERROR:

The following works:

      2 1 ⍴ 10 11
10
11

But the following gives a DOMAIN ERROR:

      x←2
      x 1 ⍴ 10 11
DOMAIN ERROR
      x 1⍴10 11
      ^  ^

This happens even if the variable reference is itself stored in a variable:

      value←2   ⍝ 'value' is now assigned the value 2
      x←2 1     ⍝ x contains the list (2 1)
      y←value 1 ⍝ y should be the same as x
      x         ⍝ Let's confirm x's contents
2 1
      y         ⍝ y seems to be the same as x here
2 1
      x ⍴ 2 1   ⍝ Reshape with x works correctly
2
1
      y ⍴ 2 1   ⍝ But reshaping with y doesn't
DOMAIN ERROR
      y⍴2 1
      ^^

Is this a bug? I can't see what I could have done wrong here.

Regards,
Elias

reply via email to

[Prev in Thread] Current Thread [Next in Thread]