chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Argv in scripts vs argv in compiled code.


From: felix
Subject: Re: [Chicken-users] Argv in scripts vs argv in compiled code.
Date: Thu, 22 Aug 2002 08:56:10 +0200

Hi, William!

> wazor /u/annis/tmp/argv $ cat c1.scm 
> #!/u/annis/local/bin/csi -script
> 
> (print (argv))
> 
> wazor /u/annis/tmp/argv $ ./c1.scm 
> (/u/annis/local/bin/csi -script ./c1.scm)
> wazor /u/annis/tmp/argv $ csc c1.scm 
> wazor /u/annis/tmp/argv $ ./c1
> (./c1)
> ----------------------------------------
> 
> Do other people consider this, if not a bug, then a misfeature?  I
> like the idea of being able to use chicken interpreted or compiled as
> the mood suits, and I'd rather not have to do environment testing
> every time I consult argv.

I recommend using `(command-line-arguments)'. It returns
the arguments passed to the script/executable *without* the
stuff prefixing it. If you need to access the script/program-name,
then you have to call `argv' and check for the `-script' option.

Hope this helps.


cheers,
felix






reply via email to

[Prev in Thread] Current Thread [Next in Thread]