Hello everyone. I'm new to Squeak, and I chose to do a research paper for school on it. I have a few questions about the language. My first question is what components in Squeak can be successfully parsed by the compiler without necessarily creating a full program. For example, can a blank method be created? Create variables without using them? etc.
My second question is what constructs in the language are NOT orthogonal. I'm not sure if there is a different term for this, but basically it means what constructs cannot be used within a construct of the same type. For example, can you use a function within a function? If any help can be provided, I would greatly appreciate it. Some examples and references to the ANSI Smalltalk Reference Manual would be much appreciated as well. I was trying to find the ansers in the ANSI manual haven't had much luck. |
I would recommend you start with one of the free Smalltalk books accessible from I would counsel that "Squeak by Example" would be a great place for you start. The Smalltalk compiler in Squeak can parse empty methods successfully; Smalltalk does not have functions; methods are defined relative to an object, and cannot have methods inside them, but they can have blocks; etc. Smalltalk is deceptively complex in its simplicity. A Smalltalk grammar is extremely simple, and Smalltalk interpreters have been developed that are less than 2k lines of C code. In Smalltalk, everything, and I mean everything is an object; you'll need to do a paradigm switch to be able to make the most of the power offered by the Simplicity in Smalltalk. regards, Dave On Nov 1, 2010, at 10:35 AM, gi.joe wrote:
|
In reply to this post by gi.joe
Hard answers. Smalltalk *is* the full program. Your application is a bit like like an extension of Smalltalk. Blank methods are fine; unless you explicitly return a value, the method will happily return self by default. Someone said that Smalltalk hasn't got functions, but I don't think that's really the best way to put it. Smalltalk "blocks" look a lot like lambdas, and in modern days have full closure semantics. They're also first class objects, so you can stick them in variables and interact with them more or less like anything else. You can nest blocks.
I'd strongly recommend reading the "Blue Book" instead (Smalltalk-80: the Language and its Implementation.) Have fun and point us at your project when the time is right!
|
In reply to this post by gi.joe
On Monday 01 Nov 2010 9:05:43 pm gi.joe wrote:
> My second question is what constructs in the language are NOT orthogonal. > I'm not sure if there is a different term for this, but basically it means > what constructs cannot be used within a construct of the same type. In Smalltalk, every construct (i.e. constructed from primitive objects) is an object composed from any other object or primitive. But implementations of Smalltalk do optimize representations for performance. AFAIK, CompiledMethod is one such object in Squeak. Inspect: CompiledMethod someInstance and contrast that with any other object. "Blue book", that Casey pointed out in an earlier post, is a must-read for a project like yours. Subbu |
Free forum by Nabble | Edit this page |