-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error handling #1
Comments
You are exactly right. I suggest we use Alternatively I was considering using them as the success variant of an error handling monad like Rust's So something like this: // define a functionn that can fail or succeed
THE HARD YAKKA FOR fallibleFunction IS (shouldFail) <
YA RECKON shouldFail IS A <
YEAH, NAH ~ BAIL BONZA "bonza mate!"; // successful return
NAH, YEAH ~ BAIL STREWTH "fark!"; // error
>
>
// then you can use pattern matching to handle the success/fail cases
YA RECKON fallibleFunction(YEAH, NAH) IS A <
BONZA x ~ GIMME "the function succeeded mate: " + x;
STREWTH x ~ GIMME "the function failed: " + x;
> |
I came here to suggest Edit: Alternatively, |
I'd like to suggest replacing |
Good work getting this up and into the ether @zackradisic Really want to see the WHATYARECKON<> AAHSHELLBERIGHT <> try catch block implemented |
@howsitcohendevelopment thanks m8! Couldn't have done it without the amazing and hilarious ideas you guys came up with. Totally forgot about WHATYARECKON<> AAHSHELLBERIGHT <>. I think that's preferable over the FP monad approach I mentioned until we have a type system. How should one throw an error? I think |
+1 for |
or actually,
(sorry...coming from C# here 😄 you can convert the wording haha) |
@timshepherd-academy In C# terms, the proposed
That
We haven't yet clarified exactly what the There's a discussion (#3) on how to import external files and modules into your code, which would allow for both standardized error defines using, for example, a
Which would chuck a You also then have the option to define your own error codes across your modules, in your own module, say,
|
@jwfxpr great ideas, I really like the concept of having errors as values which is what Go and Rust do. Then we can also pattern match on errors: IMPORT MAATE FROM ME MODULE "mystrewths"
WHAT YA RECKON <
strewthItsADogsBreakfast(x)
> AHHSHELLBERIGHT(fuck) <
YA RECKON fuck IS A <
MAATE.BUGGER_ALL_PARAMETER ~ GIMME "fuckin' hell mate, pass somethin in";
MAATE.DOGS_BREAKFAST ~ GIMME "FAARK!";
buggeredIfIKnow ~ GIMME "carn";
>
> |
It is not clear whether BONZA and FAIR DINKUM are reserved words.
Also, whether it's FAIR DINKUM or FAIRDINKUM!
The text was updated successfully, but these errors were encountered: