[Pharo-users] Help me make sense of this (AST manipulation)
victor-rene.dev at outlook.com
Tue May 3 07:58:01 EDT 2016
| f g h |
f := '[ :a | ^a + 1 ].'. " Message pattern expected "
g := '| b |'. " '|' expected "
h := '| b ||'. " Success?!? "
OpalCompiler compile: f.
OpalCompiler compile: g.
OpalCompiler compile: h.
Basically I went from writing a function to clean up StringMorphs on the World...
"Clean up string morph in world."
| x y |
x := World submorphs.
y := [ x select: [ :each | (each isMemberOf: StringMorph) ] ].
y value do: [ :each | each delete ].
...to wondering how to generalize the idea (pass the class as an argument)...
...but that would be too easy, so why not manipulate the AST programatically...
I read https://marcusdenker.de/publications/Bera13a-OpalIWST.pdf but the compiler
thinks I am a fool :-(
My guess is I need to know what are the method calls from text to AST to bytecode.
Victor RENESoftware engineer,Game designer, Writer
Blog: http://victor-rene.comProjects: http://logiqub.com
tel: +33 6 26 83 61 76email: victor-rene at outlook.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Pharo-users