Newbie question: Command line arguments in Common Lisp?
From: David Buchan (David_at_pdbuchan.com)
Date: 12/30/04
- Next message: Svein Ove Aas: "Re: Newbie question: Command line arguments in Common Lisp?"
- Previous message: Julian Stecklina: "Re: the best Linux for me"
- Next in thread: Svein Ove Aas: "Re: Newbie question: Command line arguments in Common Lisp?"
- Reply: Svein Ove Aas: "Re: Newbie question: Command line arguments in Common Lisp?"
- Reply: David Buchan: "Re: Newbie question: Command line arguments in Common Lisp?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 30 Dec 2004 11:13:15 -0500
Hi guys,
In C language, you can type arguments at the command line and have your
program pick them up and use them. For example, I could write a dos2unix
program and have the name of the file to be cleaned, passed into main
via array argv.
At the command prompt I would type:
dos2unix[.exe] filename
and the file would be cleaned of carriage-returns.
The code would look something like:
int main (char *argv[])
{
FILE *fi;
fi=open(argv[[1],"r");
etc.
FORTRAN now allows this, except that you access the arguments by using
the getarg intrinsic procedure.
Perl, an interpreted language, also allows this. The arguments are in
@argv and you use shift @argv to access each one.
Can I do something similar in Common Lisp?
Thanks,
Dave
- Next message: Svein Ove Aas: "Re: Newbie question: Command line arguments in Common Lisp?"
- Previous message: Julian Stecklina: "Re: the best Linux for me"
- Next in thread: Svein Ove Aas: "Re: Newbie question: Command line arguments in Common Lisp?"
- Reply: Svein Ove Aas: "Re: Newbie question: Command line arguments in Common Lisp?"
- Reply: David Buchan: "Re: Newbie question: Command line arguments in Common Lisp?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|