[Openmcl-devel] TIL how to access command line arguments in a saved application

Didier Verna didier at lrde.epita.fr
Thu Aug 16 01:42:59 PDT 2012

Ron Garret <ron at flownet.com> wrote:

> Today I tried this:
> [ron at mighty:~]$ ccl
> Welcome to Clozure Common Lisp Version 1.9-dev-r15341M-trunk  (DarwinX8664)!
> ? (defun foo () (print CCL:*UNPROCESSED-COMMAND-LINE-ARGUMENTS*) (print 'foo))
> ? (save-application #P"~/foo" :prepend-kernel t :toplevel-function 'foo)
> [ron at mighty:~]$ ./foo baz bar -- bing boff
> NIL 
> FOO 
> Not the result I was expecting. So I dug around in the sources and discovered
> that the way to access command line arguments in your own top-level function
> is through the global variable *command-line-argument-list*.

  FWIW, you can look at the CMDLINE function in Clon. It does this for 8
compilers currently.

Resistance is futile. You will be jazzimilated.

Scientific site:   http://www.lrde.epita.fr/~didier
Music (Jazz) site: http://www.didierverna.com

More information about the Openmcl-devel mailing list