clisp --help
‘s line -c [-l] lispfile [-o outputfile] - compile lispfile
got my curiosity.
Stack Overflow told me i can access command line arguments with *args*
.
So let’s compile the 8th of the 99-lisp-problems.
1 | (defun unique (lst) |
running clisp -c unique.lisp
and changing execution permissions.1
2
3phil@HAL:~/development/lisp/scratchpad$ 🐵 clisp -c unique.lisp
phil@HAL:~/development/lisp/scratchpad$ 🐵 chmod 755 unique.fas
phil@HAL:~/development/lisp/scratchpad$ 🐵 mv unique.fas unique
to let bash know how to execute it, prepend the shebang line #!/usr/bin/clisp
(or find out ur own path to clisp with whereis clisp
) to unique.fas
.
et voila:
1 | phil@HAL:~/development/lisp/scratchpad$ 🐵 ./unique a b c c c d d e f f |
symbolic linking unique
to /usr/bin with ln -s
would let us call it without the ./
and would let it look like some of our gnu utils or shell builtin ;)