-
Notifications
You must be signed in to change notification settings - Fork 173
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
Support method missing #672
Conversation
vm/instruction.go
Outdated
// TODO: Improve this | ||
t.Stack.Push(&Pointer{Target: nil}) | ||
|
||
for i := argCount - 1; i >= 0; i-- { |
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.
@eliothedeman @saveriomiroddi Because we need to append method's name as first argument, so we have an O(n) operation here. I'd be very happy if anyone can solve this elegantly
Codecov Report
@@ Coverage Diff @@
## master #672 +/- ##
==========================================
+ Coverage 81.82% 81.86% +0.04%
==========================================
Files 57 57
Lines 7708 7725 +17
==========================================
+ Hits 6307 6324 +17
Misses 1132 1132
Partials 269 269
Continue to review full report at Codecov.
|
@@ -604,39 +625,39 @@ var builtinActions = map[operationType]*action{ | |||
}, | |||
} | |||
|
|||
func (vm *VM) InitObjectFromGoType(value interface{}) Object { | |||
switch v := value.(type) { | |||
func (v *VM) InitObjectFromGoType(value interface{}) Object { |
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.
exported method VM.InitObjectFromGoType should have comment or be unexported
@@ -604,39 +625,39 @@ var builtinActions = map[operationType]*action{ | |||
}, | |||
} | |||
|
|||
func (vm *VM) InitObjectFromGoType(value interface{}) Object { | |||
switch v := value.(type) { | |||
func (v *VM) InitObjectFromGoType(value interface{}) Object { |
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.
exported method VM.InitObjectFromGoType should have comment or be unexported
I just wonder if |
@@ -604,39 +625,39 @@ var builtinActions = map[operationType]*action{ | |||
}, | |||
} | |||
|
|||
func (vm *VM) InitObjectFromGoType(value interface{}) Object { | |||
switch v := value.(type) { | |||
func (v *VM) InitObjectFromGoType(value interface{}) Object { |
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.
Thank you!
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.
Looks fine to me. We can probably clean up the stack rewriting part when we move to option types. Thanks for unblocking me!
Not support
method_missing
's inheritance but support singleton class'method_missing