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
{{ message }}
This repository has been archived by the owner on May 23, 2021. It is now read-only.
Most of the Value types (except for Symbol, List, Vector, Set), return themselves on Eval().. It seems like a redundant requirement to have all Values implement the Eval() method when in most cases it's not required.. I am considering may be it would be simpler to remove this and make Eval() an optional interface.. We have 3 possibilities:
Remove the Value type altogether and deal with interface{} types.
Turn Value into a marker interface like below:
// Remove Eval() from current Value interface and rename String() to Source()// to avoid ambiguity with commonly used fmt.StringertypeValueinterface {
Source() string
}
Not do anything and keep it as is.
If we choose 1 or 2, eval requirement can become an optional interface:
typeExprinterface {
Eval(scopeScope) (Value, error) // or (interface{}, error) based on 1 or 2
}
Yep agreed on all. Performance is not big enough concern to warrant any targeted optimization but I would still like to keep the overhead to minimum. I've decided to keep it as is for now. We can think about this again at some point later..
Most of the Value types (except for Symbol, List, Vector, Set), return themselves on
Eval()
.. It seems like a redundant requirement to have all Values implement theEval()
method when in most cases it's not required.. I am considering may be it would be simpler to remove this and make Eval() an optional interface.. We have 3 possibilities:Remove the
Value
type altogether and deal withinterface{}
types.Turn
Value
into a marker interface like below:Not do anything and keep it as is.
If we choose 1 or 2, eval requirement can become an optional interface:
@lthibault Any thoughts on this ?
The text was updated successfully, but these errors were encountered: