dictu-lang / Dictu

Dictu is a high-level dynamically typed, multi-paradigm, interpreted programming language.
https://dictu-lang.com
MIT License
268 stars 53 forks source link

[FEATURE] Error type to be falsey #705

Open Jason2605 opened 9 months ago

Jason2605 commented 9 months ago

Is there an existing issue for this?

Is your feature request related to a problem?

Currently this snippet will evaluate to true since we don't check Result types when determining a falsey value

if (Error("error")) {
    print("AAAA");
}

It's probably worth considering marking Error<> types as falsey, then things like .success() are no longer needed, shortening some of the checks (will probably keep it though to keep compatibility)

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response