Hey all,
Holger Freyther, I didn't know about ##() and once in GNU Smalltalk, but that was definitely what I was trying to experiment with.
As Thierry mentioned, these elements come from C/C++ where you have macros that are very useful when writing high performance code so your code can be both flexible and very efficient.
Ben you're right, normal users should not be confused by those features or new syntax elements. For CValue, I added class-side of the classes using it:
MyClass>>#compiler
| comp |
comp := super compiler.
comp compilationContext semanticAnalyzerClass: NeoCompiler.
^ comp
I think the solution for this problem is to do another Opal compilation options for precompilation. This way, if you want to use your compiler extension, you have either to:
- override #compiler class side for a hierachy of classes granularity
- add a pragma such as <compilationOptions: + optionPrecompilation> for a per method granularity
then in the methods affected by the compiler extension, you can either use a different parser with new syntax elements such as ##() or use new special selectors such as #once or #Cvalue.��