0.1 version released. This is the first real release in form of a Tcl package. See the download section for the download URL.
This document will try to explain what Sugar macros are, how they can be applied, and why I think they improve the Tcl language.
Note that the idea of a macro system for Tcl is not new, but as far as I know, there is no implementation that is comparable with Sugar in terms of usage and design principles. Something of similar in the spirit, is the Tmac - a Tcl macro processor package, but it works by pattern matching and substitution, requires the user to use a special syntax, does not guarantee the expansion to happen only where actually a command can be called, and can't be used to add arbitrary new syntax to Tcl (syntax macros feature of Sugar), nor complex code transformation (see for example the transformer macro to optimize tail calls in this document).
The following sections will explain the basic Sugar API with some detail, but it's worth to say now that macro expansion happens when the proc command is called. Actually Sugar is a wrapper for proc, an API to write source code transformations, and some command to register this transformations in the modified version of proc.
You may also want to check the Sugar macros collection page.
Also, Sugar is available in Debian and Debian-derived Linux distributions (such as Ubuntu) as tcl-sugar.
If you have suggestions, bugfixes or API changes requests, please drop me an email at antirez at invece dot org.
See also run.
SUGAR is also an open source CRM (Customer Relationship Management) application.