Hacker News new | ask | show | jobs
by ksaj 2655 days ago
FWIW you already can run lisp code as a script, at least under Linux. I've been doing the following for quite some time without issue:

--- xx

#!/usr/bin/clisp

(format t "yup")

---

and then on the command line:

> chmod a+x xx ; ./xx

yup

Caveat: You have to comment out the hashbang if you want to (LOAD 'xx) in the repl, or it will puke unceremoniously. It would be nice if repl devs allowed the LOAD function to simply treat it as a ; symbol since it wouldn't break anything and is more consistent with the cli behaviour.

I've only done this with clisp, so maybe other Lisp variants like sbcl et al already do this. YMMV.

EDIT: Realized the script came out all on one line. Fixed.