Command-line arguments: Difference between revisions

→‎{{header|Common Lisp}}: add a function for a univorm way to access arguments
(→‎{{header|Common Lisp}}: add a function for a univorm way to access arguments)
Line 252:
=={{header|Common Lisp}}==
 
The Common Lisp standard does not specify anything relating to external invocation of a Common Lisp system. The method for getting command-line arguments varies by implementation;. here are some examples:
 
The following function could be used to create a uniform way to access the arguments:
{|
! Implementation !! Expression !! Includes program name (argv[0])
|-
| SBCL || sb-ext:*posix-argv* || Yes
|-
| CLISP || ext:*args* || No
|}
 
<lang lisp>(defun argv ()
All of these return a list of strings.
(or
| #+SBCL || sb-ext:*posix-argv* || Yes
#+LISPWORKS system:*line-arguments-list*
#+CMU (cons "cmucl" extensions:*command-line-words*)
| #+CLISP ||(cons "clisp" ext:*args* || No)
nil))</lang>
 
=={{header|D}}==
Anonymous user