Program name: Difference between revisions

More idiomatic, better use of Leiningen
(Added Mozart/Oz)
(More idiomatic, better use of Leiningen)
Line 232:
 
=={{header|Clojure}}==
<lang clojure>":";exec cljlein -m `basename $0 .clj`exec $0 ${1+"$@"}
If the shebang is used to run the script directly, this prints the script name. Otherwise, it prints nil.
 
<lang clojure>":";exec clj -m `basename $0 .clj` $0 ${1+"$@"}
":";exit
 
(ns scriptname
(:gen-class))
 
(defn -main [& args]
(deflet [program (nthfirst *command-line-args 0)*)]
(println "Program:" program))</lang>)
 
(when (.contains (first *command-line-args*) *source-path*)
(apply -main (rest *command-line-args*)))</lang>
 
=={{header|Common Lisp}}==
Anonymous user