Scripting with Chicken
Today a cool script was posted to the chicken-users mailing list. Not only does it illustrate how to make an egg, it also demonstrates how to use Chicken Scheme as a scripting language.
The eggify function is somewhat long, but still relatively easy to read; the second let* part is long, but not complicated, as it can be read line by line. It almost reads like line-for-line statements, e.g.
# pseudo-translation to Python metafile = metafiles[0] metadata = handle_exceptions(...) egg(metadata['egg'][0]) ...etc...
And the actual body of it is just three "statements" (yeah, yeah, I know Scheme doesn't really have statements), dealing with the file system and issuing commands (like tar).
This is of course nothing special for languages that are often regarded as "scripting languages" -- like Perl, Python and Ruby -- but it's unusual to see it in Scheme. I'm delighted that it's possible. This is one of the reasons I like Chicken -- it tends to be more "real world" and "pragmatic" than some other implementations.