From: Klaus W. <kw...@w-...> - 2006-01-27 00:20:27
|
On Thu, Jan 26, 2006 at 01:24:43PM -0500, Sam Steingold wrote: > > * Klaus Weidner <xj@j-z-c.pbz> [2006-01-26 11:43:47 -0600]: > > :argument-handler :standalone > > > > All arguments, including flags starting with '-', are placed into > > the EXT:*ARGS* variable. This allows standalone executables to > > fully handle all argument processing. The application is > > responsible for handling any flag arguments normally handled > > by the CLISP runtime if that functionality is required. > > this will disable -M and -x. > I understand that someone might want to re-implement "ls" with clisp and > this will prevent him. My understanding is that you can't use any flags introduced with "-" if the default argument handling is active, since they'll get parsed by the clisp runtime and it'll produce the "invalid command-line option" message before your application even gets a chance to look at them. I guess I could live with a mixed mode where the clisp runtime would look at the arguments and then extracts and handles those it knows, leaving the rest for the application. But the default clisp argument set would cause far too many collisions, it uses many single-letter flags for its own purposes. It would cause less collisions if, in :standalone mode, clisp would handle only -M and -x, or (preferably) only long-form versions --mem-size and --expressions, and pass all others to ext:*args*. > Nevertheless, I believe it is important that someone who receives a > clisp-based application can get a clisp repl by merely typing [...] > $ app -x '(saveinitmem "clisp" :executable t)' > $ ./clisp Would one of these alternatives also be acceptable? app --clisp-args -x '(saveinitmem "clisp" :executable t)' (a magic --clisp-args switch which, if it's the first argument, overrides the :standalone flag and gives argument handling control back to the CLISP runtime) CLISP_EXPRESSIONS='(saveinitmem "clisp" :executable t)' ./app BTW, the new standalone SAVEINITMEM produces programs whose mechanics don't quite match the discussion in the COPYRIGHT file. They are produced with SAVEINITMEM but don't allow easy rebuilding using a CLISP rebuilt from source. I think the spirit of the COPYRIGHT file could be maintained if there'd be a flag "--detach-image" (non-overridable) or comparable functionality so you could do something like this to run it against a home built clisp: ./app --clisp-args --detach-image "exe.mem" my-own-clisp -M exe.mem -x ... Would this be reasonably easy (in other words, are they essentially just concatenated) or would it involve a lot of processing? -Klaus |