21752-add-asDoit-and-asDoitIn-to-AST#1237
21752-add-asDoit-and-asDoitIn-to-AST#1237MarcusDenker merged 3 commits intopharo-project:developmentfrom MarcusDenker:21752-add-asDoit-and-asDoitIn-to-AST
Conversation
| arguments: { RBVariableNode named: 'ThisContext' } | ||
| body: (RBReturnNode value: self) asSequenceNode. | ||
|
|
||
| methodNode := self asDoitIn. |
There was a problem hiding this comment.
Will not it be better to introduce "asDoitIn: aContext" instead of no arg asDoitIn?
Looks like this place is the only sender.
There was a problem hiding this comment.
but you do not need the aContext there... and more important: you might not even have it at the point where you call the method. (as this just compiles a method, that method later can take the context as an argument)
There was a problem hiding this comment.
I just like how no arg evaluate looks now. And I thought that context version can be similar:
methodNode := self asDoitIn: aContext.
^methodNode generateWithSource valueWithReceiver: aContext receiver arguments: {aContext}.And it leads me to think that #asDoItIn is not needed at all because the result is supposed to be used with context (does it?). Do you see other scenarios?
There was a problem hiding this comment.
ah, ok. Yes, this is possible. I will do it in the next iteration. and the name should maybe be asDoItForContext:
add asDoit and asDoitIn to AST
https://pharo.fogbugz.com/f/cases/21752/add-asDoit-and-asDoitIn-to-AST