|
From: SourceForge.net <no...@so...> - 2010-12-11 15:51:32
|
Feature Requests item #3124233, was opened at 2010-12-01 05:55 Message generated for change (Comment added) made by haible You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=351355&aid=3124233&group_id=1355 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. >Category: Extend ANSI CL Group: None >Status: Closed Resolution: Wont Fix Priority: 5 Private: No Submitted By: Andrew Pennebaker (mcandre) Assigned to: Bruno Haible (haible) Summary: *args* omits script name (if any) Initial Comment: 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/ ---------------------------------------------------------------------- >Comment By: Bruno Haible (haible) Date: 2010-12-11 16:51 Message: 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. ---------------------------------------------------------------------- Comment By: Sam Steingold (sds) Date: 2010-12-01 15:32 Message: 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. ---------------------------------------------------------------------- Comment By: Andrew Pennebaker (mcandre) Date: 2010-12-01 08:24 Message: *load-pathname* is the name of the currently loading file, not necessarily the file indicated by calling clisp somefile.lisp. I petition CLISP to add something equivalent to Python's if __name__=="__main__" or Ruby's if __FILE__==$0. Basically, I'd like CLISP's *args* to operate like SBCL, Clozure, GCL, ECL, CMUCL, AllegroCL, and LispWorks. Notice the use of cdr in http://common-lisp.net/gitweb?p=projects/qitab/command-line-arguments.git;a=commitdiff;h=19866582857b3431e01c945afb62e9366e919f07 ---------------------------------------------------------------------- Comment By: Pascal J. Bourguignon (informatimago) Date: 2010-12-01 06:49 Message: You can use *load-pathname* to get the script name. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=351355&aid=3124233&group_id=1355 |