This isn't completely accurate. *LOAD-TRUENAME* is overwritten when you (load) other code files, so it doesn't let you reliably get the original script name. This difference is detectable in general scripting languages such as Ruby:

if __FILE__==$0
main
end

How can this be done in CLISP? So far, I can manage with a shebang hack, but it prevents the code from dot slashing properly with other CLs.


On Tue, Nov 20, 2012 at 11:03 AM, Sam Steingold <sds@gnu.org> wrote:
> * Andrew Pennebaker <naqerj.craaronxre@tznvy.pbz> [2012-11-20 09:39:02 -0500]:
>
> Many CL's offer a way to retrieve the Lisp script name, but CLISP
> appears to silently drop this information.

http://clisp.org/impnotes/quickstart.html#script-exec
   The file is loaded normally, through the function LOAD (in
   particular, the name of the script file, which is $0 in /bin/sh, can
   be found in *LOAD-TRUENAME* and *LOAD-PATHNAME*).

http://clisp.org/impnotes/faq.html#faq-fine


--
Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000
http://www.childpsy.net/ http://www.PetitionOnline.com/tap12009/
http://truepeace.org http://camera.org http://www.memritv.org
He who laughs last did not get the joke.



--
Cheers,

Andrew Pennebaker
www.yellosoft.us