phantomics / april

The APL programming language (a subset thereof) compiling to Common Lisp.
Apache License 2.0
602 stars 31 forks source link

Problems with commute + rank #248

Closed paulapatience closed 1 year ago

paulapatience commented 2 years ago

With ⍤0:

CL-USER> (april:april-c "4⍪⍨⍤0⍳3")
#2A((1 4) (2 4) (3 4)) ; correct result
CL-USER> (april:april-c "4⍪⍤0⍨⍳3")
#(1 4)

With ⍤1:

CL-USER> (april:april-c "⍪⍤1⍨⍳3")
#(1 2 3 1 2 3)
CL-USER> (april:april-c "4⍪⍤1⍨⍳3")
; Debugger entered on #<TYPE-ERROR expected-type: UNSIGNED-BYTE datum: -1>
[1] CL-USER> 
; Evaluation aborted on #<TYPE-ERROR expected-type: UNSIGNED-BYTE datum: -1>
CL-USER> (april:april-c "4⍪⍨⍤1⍳3")
#(1 2 3 4) ; correct result
phantomics commented 1 year ago

These bugs are fixed.