Re: argv[0] not available to CLISP programs

Andrew Pennebaker <[email protected]>
Newsgroups gmane.lisp.clisp.devel
Message-ID <CAHXt_SVdYOhM6sK4_fWyZPiwOhyRaOD70SJXWe5mzxpg_AK2aQ@mail.gmail.com>
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<https://github.com/mcandre/scriptname/blob/master/scriptname.lisp>,
but it prevents the code from dot slashing properly with other CLs.


On Tue, Nov 20, 2012 at 11:03 AM, Sam Steingold <[email protected]> wrote:

> > * Andrew Pennebaker <[email protected]> [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

------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov

_______________________________________________
clisp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/clisp-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.