[CSC 330] Command line arguments for Lisp

Andrew J. Pounds pounds at sandbox.mercer.edu
Sat Nov 19 01:37:41 EST 2022


Did you look for information on SBCL or just LISP -- the answer depends 
on the implementation.  For SBCL under Linux you can do something like


#!/usr/bin/sbcl --script

(princ (nth 2 sb-ext:*posix-argv*) )
(terpri)
(princ (nth 1 sb-ext:*posix-argv*) )
(terpri)


and then run with

clarg.lisp order swap


will produce


swap

order



On 11/17/22 15:53, Saif Hasan wrote:
> Dr. Pounds,
>
> I have been looking all over the internet on how to command line 
> arguments for Lisp. So far, I have not found anything that works.
> Could you please help me with that?
>
> If I can't get it working before the due date, I will ask for input 
> during runtime only for my Lisp code. I will make sure to state
> that in my top-level readme.
>
>
-- 
*/Andrew J. Pounds, Ph.D./*
/Professor of Chemistry and Computer Science/
/Director of the Computational Science Program/
/Mercer University/
/1501 Mercer University Drive, Macon, GA 31207 /
/(478) 301-5627/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://theochem.mercer.edu/pipermail/csc330/attachments/20221119/55f4181a/attachment.html>


More information about the csc330 mailing list