xpqz / learnapl

Introduction to Dyalog APL: https://xpqz.github.io/learnapl
Other
126 stars 11 forks source link

Domain Error #23

Closed sohang3112 closed 2 years ago

sohang3112 commented 2 years ago

In Indexing > Assignable indexing expressions, the first code (given) block doesn't work on my machine:

]DISPLAY m ← 3 3⍴9?9
(0 0⍉m) ← ¯1 ¯1 ¯1 ⍝ 0 0⍉m is the main diagonal.
]DISPLAY m

Expected

Replace main diagonal of matrix m.

Actual

On the second line, 0 0⍉m raises DOMAIN ERROR.

Environment Info (copied from Dyalog > About)

IDE: Version: 4.4.1 Platform: Linux x86_64 Date: 2021-12-03 13:35:27 +0100 Git commit: 6248a881ddba8a03befe08106cd02ee7e47b1fe1 Preferences:{ "kbdLocale":"en_US" }

Interpreter: Version: 18.0.40684 Platform: Linux-64 Edition: Unicode/64 Date: Jun 19 2021 at 00:08:29

sohang3112 commented 2 years ago

Oops, sorry, I missed that you have to use ⎕IO ← 0 !