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.
What's a pseudovariable? Does a pseudovariable reference a first class object? Is the thing known as true an object, is this a pseudovariable? 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. Does this confuse other people too?
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?
What if I wanted to introduce a synonym for super, say: mom? :P I've been rummaging today trying to figure out where these things live and how they work. Any guidance would be much appreciated!
|
Take a look at Parser.
Nicolas 2010/4/15 Casey Ransberger <[hidden email]>: > 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. > What's a pseudovariable? Does a pseudovariable reference a first class > object? Is the thing known as true an object, is this a pseudovariable? 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. Does this confuse other people too? > 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? > What if I wanted to introduce a synonym for super, say: mom? :P > I've been rummaging today trying to figure out where these things live and > how they work. Any guidance would be much appreciated! > > > |
In reply to this post by Casey Ransberger-2
On 15.04.2010, at 03:47, Casey Ransberger wrote: 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. 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". Also true, false, nil are called pseudo variables, though they aren't "variable" at all. Syntactically all these are variables, but you can't store into them.
Like every other variable, sure.
Yes, true is an object, the singleton instance of True.
Some message sends are rewritten by the Compiler. E.g., an ifTrue: is not really sent but compiled to a conditional jump bytecode. 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").
Not me :)
In the Parser / Compiler.
Same place.
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. - Bert - |
Free forum by Nabble | Edit this page |