You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to understand why error and immutable and are keywords. It's quite easy to convert them to builtins, and there are a few reasons to do so:
Those two and import are the only keywords which behave like functions.
Casting to other types utilises builtin functions, not keywords.
error isn't a keyword in golang.
error is a method name in some popular libraries (e.g.: by resty, logrus), and since tengo doesn't allow using keywords as selectors keywords as selectors #301, it makes using them difficult.
The only downside I see is a negligible performance hit, since those function calls are made in a run time.
The text was updated successfully, but these errors were encountered:
I'm trying to understand why
error
andimmutable
and are keywords. It's quite easy to convert them to builtins, and there are a few reasons to do so:import
are the only keywords which behave like functions.error
isn't a keyword in golang.error
is a method name in some popular libraries (e.g.: by resty, logrus), and since tengo doesn't allow using keywords as selectors keywords as selectors #301, it makes using them difficult.The only downside I see is a negligible performance hit, since those function calls are made in a run time.
The text was updated successfully, but these errors were encountered: