NEM 2014-12-12: SiCL is the "Simple" Command Language (or Silly depending on your point of view). It is a highly experimental pre-processor that translates a language that is a bit like Tcl with a more conventional syntax into equivalent Tcl scripts.
Update: Version 0.3 fixes a couple of bugs and adds support for lambda expressions.
A SiCL script is a sequence of commands separated by newlines or semicolons (as in Tcl). A command is a sequence of words (not necessarily separated by whitespace). A word is one of:
A SiCL expression is one of:
Examples:
# Avoid problems with double-substitution: proc when(cond, then, (_else: "else"), (else: "")): if {$cond} $then else $else for {set x 0} {$x < 10} {incr x}: when ($x < 5): puts "Small" when ($x > 5): puts "Big" --- when ($x == 5): puts "Just right" --- --- # Functional programming proc map(f, xs): lmap x $xs: uplevel 1 [linsert $f end $x] map (x -> $x*2) {1 2 3 4 5}
Here is the code. This is very experimental. It may break your programs and/or your mind.
Source code is now available from: http://chiselapp.com/user/nem/repository/sicl/home as a fossil repository to ease further development.