Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#44 *args* omits script name (if any)

closed-wont-fix
Bruno Haible
5
2010-12-11
2010-12-01
No

Scripting with Common Lisp would be a lot easier if *args* included the lisp file loaded by clisp.

E.g., ./myscript.cl and clisp.cl would have *args* => ("myscript.cl")

One workaround is to use shebang trickery. http://speely.wordpress.com/2010/11/27/writing-scripts-with-common-lisp/

Discussion

  • You can use *load-pathname* to get the script name.

     
  • Sam Steingold
    Sam Steingold
    2010-12-01

    Pascal is right; *load-pathname* is what you want.
    http://clisp.sourceforge.net/impnotes/quickstart.html#quickstart-unix

    You are asking me to introduce a gratuitous incompatibility with the previous versions of clisp.
    While I agree that it is a good idea to offer an interface similar to other CL implementations,
    I don't see much benefit in this specific change.

     
  • Sam Steingold
    Sam Steingold
    2010-12-01

    • labels: 100543 -->
    • status: open --> pending-wont-fix
     
  • Bruno Haible
    Bruno Haible
    2010-12-11

    I agree with Sam. The piece of code that you pointed to
    <http://common-lisp.net/gitweb?p=projects/qitab/command-line-arguments.git;a=blob;f=get-command-line-arguments.lisp;h=02af126783ec366c974c22ad3a4e37b099213b69>
    indicates that what people want in most cases is the list of arguments. That's why FaRe's function there
    contains a cdr call for most CL implementations. So clisp's ext:*args* corresponds already exactly
    to what people want in most cases. You're asking to change that; it makes no sense.

     
  • Bruno Haible
    Bruno Haible
    2010-12-11

    • labels: --> Extend ANSI CL
    • status: pending-wont-fix --> closed-wont-fix