APL.jl icon indicating copy to clipboard operation
APL.jl copied to clipboard

"apl iota" does not work only \iota

Open Thomashrb opened this issue 3 years ago • 5 comments

Using the same unicode for iota that APL uses gives this

julia> apl"⍳2"
ERROR: LoadError: ⍳: undefined APL symbol
Stacktrace:
 [1] parse_apl(s::String, i::Int64, paren_level::Int64, curly_level::Int64)
   @ APL ~/.julia/packages/APL/qzFcC/src/parser.jl:85
 [2] parse_apl(str::String)
   @ APL ~/.julia/packages/APL/qzFcC/src/parser.jl:45
 [3] var"@apl_str"(__source__::LineNumberNode, __module__::Module, str::Any)
   @ APL ~/.julia/packages/APL/qzFcC/src/APL.jl:11
in expression starting at REPL[42]:1

However using \iota works.

julia> apl"ι2"
1:2

Unicode codepoints:

julia> codepoint('ι')
0x000003b9

julia> codepoint('⍳')
0x00002373

I am not sure if this is intended but I couldn't find that documented anywhere if so. If it is not intended I am not sure what the solution is but perhaps it makes sense to support both?

Thomashrb avatar Feb 01 '22 22:02 Thomashrb

Many of APL's symbols are specifically reserved for it due to its historical significance.

Hence, most widely used APL implementations use only (APL FUNCTIONAL SYMBOL IOTA), and not ι (GREEK SMALL LETTER IOTA) as their iota.

razetime avatar Apr 19 '22 12:04 razetime

Open to a PR adding all of them!

shashi avatar Apr 19 '22 16:04 shashi

There appear to be two that can be added:

ι | greek small letter iota | 01671 | 953 | 0x3B9 | ι
ɩ | latin small letter iota | 01151 | 617 | 0x269 | ɩ

razetime avatar Apr 19 '22 17:04 razetime

By all of them, I mean all the APL alternatives to the standard ones this package uses. I just figured being able to type into the julia repl is important.

shashi avatar Apr 19 '22 18:04 shashi

Got it. Added the symbol in #9.

razetime avatar Apr 21 '22 12:04 razetime