How programs get run
How programs get run
Posted Jan 29, 2015 21:56 UTC (Thu) by peter-b (guest, #66996)In reply to: How programs get run by wahern
Parent article: How programs get run
GNU Guile has a special "meta switch" which instructs the interpreter to interpret the first few lines of the file -- up to a line containing only "!#" -- as arguments to the interpreter rather than as source code. It seems to work quite well:
#!/usr/local/bin/guile \
-e main -s
!#
(define (main args)
(map (lambda (arg) (display arg) (display " "))
(cdr args))
(newline))
