phantomics / april

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

Result of bracketed function with rank doesnt get bound to variable (or print) #254

Closed faeredia closed 1 year ago

faeredia commented 2 years ago

+⍤1⊢ and (+⍤1) are behaving differently when binding to a variable or printing

This works as expected:

> (april:april "⎕← x← 10 20 +⍤1⊢ 2 2⍴⍳4 ⋄ x")
11 22
13 24
#2A((11 22) (13 24))

This does not:

> (april:april "⎕← x← 10 20 (+⍤1) 2 2⍴⍳4 ⋄ x")
The variable APRIL-WORKSPACE-COMMON::|x| is unbound.

Oddly, with no printing or assignment, it returns the right answer:

> (april:april "10 20 (+⍤1) 2 2⍴⍳4")
#2A((11 22) (13 24))
> ;; This doesn't print
> (april:april "⎕← 10 20 (+⍤1) 2 2⍴⍳4")
#2A((11 22) (13 24))
phantomics commented 1 year ago

This now works.