On Sat, 2008-12-27 at 01:39 -0500, Abdulaziz Ghuloum wrote: > (apply > (case-lambda > [(script script-name) (compile script-name)] > [(script . args) (error #f "usage: ~a <script-name>" script)]) > (command-line))
> And BTW, does anybody have a good way of handling command-line > arguments, other than using apply and case-lambda like I'm > doing above? I've always thought, when you don't need more complex command-line arguments handling, the apply case-lambda is really slick. SRFI-37, available as library (xitomatl srfi args-fold), does POSIX and GNU -style handling. http://srfi.schemers.org/srfi-37/srfi-37.html Also, I like handling them using apply of a procedure which uses a matcher on the arguments. E.g., something like the (parse cmd-line options) example from http://groups.google.com/group/ikarus-users/browse_thread/thread/245f346d38b51d53/3facba52c812e565?lnk=gst&q=(xitomatl+match)#3facba52c812e565 or, simpler, like (main cmdln) from xitomatl/programs/irregex-tool.sps -- : Derick ----------------------------------------------------------------
