HuoLanguage / huo

interpreted language written in C
MIT License
212 stars 21 forks source link

Exceptions #35

Open TheLoneWolfling opened 8 years ago

TheLoneWolfling commented 8 years ago

Currently any errors just crash the interpreter, which is... brittle, perhaps is the word.

Do we want exceptions? Or similar methods of recoverable error-checking? If so, how do you want them to work, from an end-user point-of-view?

incrediblesound commented 8 years ago

This is a good issue to keep open, for now I like that the errors crash the interpreter. On the other hand, caught exceptions are useful tool but I haven't gotten to the point where I need to use them. I'd imagine it would look like this:

(try
   (let z (divide x y))
   (catch error (do
        (print error)
        (let z 0)
    ))
)