Search code examples
apldyalog

How do I render trains as trees in Dyalog APL using dyalogscript?


$ cat a.apl 
]Box on -trains=tree
⎕←≢,⊢
$ dyalogscript a.apl

VALUE ERROR: Undefined name: ⎕SE.UCMD

While in RIDE the same script produces:

 ≢,⊢
┌─┼─┐
≢ , ⊢

How can I get the same train rendering in dyalogscript?


Solution

  • Since ]Box is a user command, you need to enable user commands:

    (⎕NS⍬).(_←enableSALT⊣⎕CY'salt')
    

    It is likely that a future version will have a neater way to do this, namely by adding a parameter to the #! line of the script.