For instance Ronie Salgado has a small package called "Smalltel" - the name is an abbreviation for Smalltalk string template language. The package provides a class SmalltelCompiler as a subclass OpalCompiler.
There is also a class SmalltelObject overriding the method #compilerClass to return the new compiler class. With the custom compiler one can provide templates with expressions in Smalltalk, a little bit similar to what Java has with Expression Language (EL):
condition: cond value: value
^ ByteString streamContents:
<[Here goes a header:
${ cond ifTrue: [ }$
Conditional value: $( value printString )$
${ ]. }$
]>
No comments:
Post a Comment