[squeak-dev]
Blue book, the stack and reverse polish notation--please
confirm/disavow/ridicule my reasoning
gettimothy
gettimothy at zoho.com
Tue Nov 19 16:33:12 UTC 2013
Part 4 of the Blue Book--chapter 26 The implementation--in the intro there is this example:
center
^ origin + corner / 2
With these operations
Rectangle center
0 push the value of the receiver's first instance variable (origin) onto the
stack
1 push the value of the receiver's second instance variable (corner) onto the
stack
176 send a binary message with the selector +
119 push the Smalllnteger 2 onto the stack
185 send a binary message with the selector /
124 return the object on top of the stack as the value of the message (center)
In a Workspace, when I doit on 3 + 7/2 I get 5, left, right, unary, binary....rules apply.
What I see here--and please check my reasoning--is a RPN that places things onto the stack via Smalltalk's order of operation rules and then does conventional RPN processing.
In other words, Smalltalk expressions are translated to RPN and then placed on the stack.
A simple 'banish the thought' or 'yep' or 'sometimes' would be helpful as I move forward in my study. I am just trying to avoid carrying forward an improper idea that I will have to revise later when/if the facts turn out otherwise.
thx.
t
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20131119/bf67260e/attachment.htm
More information about the Squeak-dev
mailing list
|