wolfgangj / bone-lisp

The Bone Lisp programming language
Other
321 stars 21 forks source link

Support running a bone script from command-line #2

Closed dubek closed 8 years ago

dubek commented 8 years ago

If command-line arguments are passed to bone, the first argument is taken to be a name of the module (.bn suffix is added if not given). Then that module is loaded and the REPL is not started.

Also, when loading a module, if the first line of the file starts with '#', that line is skipped, to allow for executable bone scripts with a shebang line.

Example:

$ cat test-say.bn 
#!./bone
(say "ARGS= ")
(print *program-args*)
(say "\n")

$ chmod +x test-say.bn 

$ ./test-say.bn abc def ghi
ARGS= ("./bone" "./test-say.bn" "abc" "def" "ghi")