Can Coalton conditions be less wordy? #1154
Replies: 1 comment
-
This is so that the error information is stored on a struct instead of a condition class. We chose structs because struct fields are type checked while condition class slots are not. This leads to better error checking at compile time and runtime.
It could be. Currently every function that throws a user facing error is passed a file because the file is required to construct a source error. This makes it easier to see which functions can and can't error. |
Beta Was this translation helpful? Give feedback.
-
At some point soon, a swank function is going to be seeing coalton conditions that arise during compilation. It will want to return a representation of the messages and spans in the condition to emacs, to support jump-to-error.
Right now, the error printer is strongly oriented towards console output, and contains a mysterious :err field where the real information is stored.
Also, there is also a 'file' reference that is passed into about 120 functions, which is used as the referent for source spans in the printing. The caller -- who will be managing the representation of the condition (sometimes to stdout, sometimes via swank to emacs) surely has this value in hand. Could it be unthreaded?
I would imagine thrown conditions possibly looking more like the following (before, and after):
before:
after:
Beta Was this translation helpful? Give feedback.
All reactions