Yes, the comments are bad. I have a TODO entry since ages to improve it, but there was always something more important to be done. I will put it on higher priority. Marcus
On 27 Jan 2016, at 18:52, stepharo <stepharo@free.fr> wrote:
Hi
The class comment of the compiler is not useful.
The compiler accepts Smalltalk source code and compiles it with respect to a given class. The user of the compiler supplies a context so that temporary variables are accessible during compilation. If there is an error, a requestor (usually a kind of StringHolderController) is sent the message notify:at:in: so that the error message can be displayed. If there is no error, then the result of compilation is a MethodNode, which is the root of a parse tree whose nodes are kinds of ParseNodes. The parse tree can be sent messages to (1) generate code for a CompiledMethod (this is done for compiling methods or evaluating expressions); (2) pretty-print the code (for formatting); or (3) produce a map from object code back to source code (used by debugger program-counter selection). See also Parser, Encoder, ParseNode.
if I do not know how to invoke the compiler then I still have no clue. Of course one may think that I'm too stupid to learn from the system.
so I tried
Compiler new class: ATActor; parse: 'foo ^ 23'; compile
does not work. No method comment! Great. The system just tells me to stay away ah yes there is
compile: textOrStream in: aClass classified: aCategory notifying: aRequestor ifFail: failBlock "Answer a MethodNode for the argument, textOrStream. If the MethodNode can not be created, notify the argument, aRequestor; if aRequestor is nil, evaluate failBlock instead. The MethodNode is the root of a parse tree. It can be told to generate a CompiledMethod to be installed in the method dictionary of the argument, aClass."
but in the public-old.
Why do we think that documenting is not worth? Why don't we believe in comments? Why don't we believe in examples?
Seriously when I learned smalltalk in VW every class had a real comment and method too.
Stef