-
Notifications
You must be signed in to change notification settings - Fork 80
operands init #202
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
operands init #202
Conversation
@mewmew updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job on this. We should decide on the API of Operators
. Should it return a mutable list of operands or not? If it should return a mutable list, then the return type should be updated to []*value.Value
.
Hi @dannypsnl, As this will be part of the core API which defines how instructions are used, I think it is important that we take time to consider use cases and get the design just right for the I am leaning towards having
So. I would like for us to take time and consider the benefit vs. drawbacks of having a mutable list returned by the For the time being, those who need to start using the Cheers, |
Since |
No, this is why we would need to use Note, the AST walker of the From golang/go/src/cmd/fix/walk.go: switch n := x.(type) {
// pointers to interfaces
case *ast.Decl:
walkBeforeAfter(*n, before, after)
case *ast.Expr:
walkBeforeAfter(*n, before, after)
case *ast.Spec:
walkBeforeAfter(*n, before, after)
case *ast.Stmt:
walkBeforeAfter(*n, before, after)
// pointers to struct pointers
case **ast.BlockStmt:
walkBeforeAfter(*n, before, after)
case **ast.CallExpr:
walkBeforeAfter(*n, before, after)
// etc...
} |
resolve #191