amuletml / amulet

An ML-like functional programming language
https://amulet.works/
BSD 3-Clause "New" or "Revised" License
324 stars 14 forks source link

amc explain from the toplevel #276

Closed Ilazki closed 4 years ago

Ilazki commented 4 years ago

So, Amulet's errors are pretty informative, and the suggestion to use amc explain to get additional detail is very nice. That said, it's a bit weird to be in the toplevel and be given the suggestion to use a separate command line tool to get at the information.

When getting an error in the toplevel saying try 'amc explain 1001' to see it my first instinct was to see if amc was a valid function so that amc explain 1001 would be valid in the toplevel as well as the command-line, immediately followed by checking :help to see if it had any sort of :explain command to get at the information. When neither worked, I went looking for something like open import "amc.top" or open import "repl.ml" to see if Amulet has some sort of toplevel helpers module that isn't loaded by default, but saw none.

Having some way to get at this information without swapping to a different terminal would be nice.