<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On 15.04.2010, at 03:47, Casey Ransberger wrote:</div><blockquote type="cite">This is something I've been fishing through the image for for awhile, and I haven't figured it out. I'm going to give in and ask.<div><br></div><div>What's a pseudovariable? </div></blockquote><div><br></div><div>Strictly speaking self and thisContext, whose value is not fixed but differs even though it's never assigned to. "super" is an alias for "self".&nbsp;</div><div><br></div><div>Also true, false, nil are called pseudo variables, though they aren't "variable" at all.</div><div><br></div><div>Syntactically all these are variables, but you can't store into them.</div><br><blockquote type="cite"><div>Does a pseudovariable reference a first class object?</div></blockquote><div><br></div><div>Like every other variable, sure.</div><br><blockquote type="cite"><div> Is the thing known as true an object, is this a pseudovariable?</div></blockquote><div><br></div><div>Yes, true is an object, the singleton instance of True.</div><br><blockquote type="cite"><div> In the comment for True, it says "most of these methods are not sent as real messages" and "redefining these methods here will have no effect." I don't see prims there, though.</div></blockquote><br><div>Some message sends are rewritten by the Compiler. E.g., an ifTrue: is not really sent but compiled to a conditional jump bytecode.</div><div><br></div><div>To see this, write a method that uses an ifTrue: or whileTrue:, then look at the byte code (click on the method selector in the right-hand list, choose "what to show").</div><div><br></div><div><blockquote type="cite"><div>&nbsp;Does this confuse other people too?</div></blockquote><div><br></div><div>Not me :)</div></div><br><blockquote type="cite"><div>What if I had an idea for a new pseudovariable that would change the world. Like, if I wanted to create a new pseudovariable and call it 'rosebud'; where would I put it?</div></blockquote><div><br></div><div>In the Parser / Compiler.</div><br><blockquote type="cite"><div>What if I wanted to introduce a synonym for super, say: mom? :P&nbsp;</div></blockquote><div><br></div><div>Same place.</div><br><blockquote type="cite"><div>I've been rummaging today trying to figure out where these things live and how they work. Any guidance would be much appreciated!</div></blockquote></div><div><br></div><div>Learning how stuff gets compiled and executed is really fun. Maybe start with the Squeak Blue Book (edited by Guzdial and Rose). I'm sure there are other texts about it but I'm sure others could weigh in.</div><div><br></div><div>
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Lucida Grande; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="font-family: Helvetica; "><span class="Apple-style-span" style="font-family: Helvetica; ">- Bert -</span></div><br class="Apple-interchange-newline"></span>
</div>
<br></body></html>