Presource

Presource design and overriding the Smalltalk parser

Tagged:

Paolo writes that he's looking to remove the capability to override the parser for a Behavior's methods from strings passed to #compile:, as well as old-syntax method definition lists, by moving #parserClass to CompiledMethod. He mentions that Presource fares quite well with this restriction, providing full message macros just by overriding the compiler.

A terrifying Presource macro: #tclCase:choose:

Tagged:

In reference to a comment about Tcl switch, enjoy a #tclCase:choose: macro for Presource. I reproduce its class comment here:

TclSwitchMacro comment:
I expand the #tclCase:choose: pseudo-message macro, which efficiently implements something approximating the Tcl `switch' command.

A #tclCase:choose: message looks like this:

 someInput tclCase: #(#regex #nocase) choose:
     {'^<?xml' -> [#xmlFile].
      '<html>' -> [#htmlFile]}.

Syndicate content

User login