-
Notifications
You must be signed in to change notification settings - Fork 231
Expand functionality for custom types #429
Copy link
Copy link
Closed
Description
I want to add support for binary\unary ops for custom value (implements starlark.Value)
Line 720 in f738f55
| func Binary(op syntax.Token, x, y Value) (Value, error) { |
I want to add the ability to override starlark.Binary, starlark.Unary. Will you accept this PR?
PS How do I add a comparison for different types? Why can't it be done at the interface level?
pseudo code
// starlark/eval.go
var BinaryDefault = // exists function starlark.Binary
var Binary func(op syntax.Token, x, y Value) (Value, error) = BinaryDefault
// my code
func main() {
starlark.Binary = // my custom logic for binary ops
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels