ConorOBrien-Foxx / Attache

A functional language devoted to extensibility and ease of writing
https://conorobrien-foxx.github.io/Attache/
GNU Affero General Public License v3.0
9 stars 1 forks source link

Throw...Catch & better error handling #29

Open ConorOBrien-Foxx opened 6 years ago

ConorOBrien-Foxx commented 6 years ago
  1. Decide on syntax for raising and rescuing errors in Attache

  2. Make a better system of errors (perhaps by propagating errors raised upwards until reaching main or a throw-catch)

somebody1234 commented 5 years ago

:| still no throw/catch?

ConorOBrien-Foxx commented 5 years ago

I think there is but error handling is horribly mangled right now

somebody1234 commented 5 years ago

It seems that Attache<foo>Error should subclass AtError? Or if it's intentional, why?

ConorOBrien-Foxx commented 5 years ago

@somebody1234 AtError I think is another vestige.

somebody1234 commented 5 years ago

So TryCatch should really be using a Ruby try/catch instead of checking result type now?

ConorOBrien-Foxx commented 5 years ago

yes. result type was an awful idea

somebody1234 commented 5 years ago

Hmm. I guess this might need more examples of code using TryCatch before deciding on anything

somebody1234 commented 5 years ago

Might want to have, say, TryCatch[code, SyntaxError->DoSomething[_1]] like many languages have, although really it'd just be sugar for an if/else

somebody1234 commented 5 years ago

Also... 1. until reaching main? and 2. Until reaching a throw-catch works since current implementation uses ruby's errors, although there is no stacktrace yet. Do you want a stacktrace? If you do, you might want to store the filename in every token or something.