Modulinos: Difference between revisions
Content added Content deleted
(Erlang idioms) |
(Added Coffeescript) |
||
Line 217: | Line 217: | ||
(when (.contains (first *command-line-args*) *source-path*) |
(when (.contains (first *command-line-args*) *source-path*) |
||
(apply -main (rest *command-line-args*)))</lang> |
(apply -main (rest *command-line-args*)))</lang> |
||
=={{header|Coffeescript}}== |
|||
scriptedmain.coffee: |
|||
<lang coffeescript>#!/usr/bin/env coffee |
|||
meaningOfLife = () -> 42 |
|||
exports.meaningOfLife = meaningOfLife |
|||
main = () -> |
|||
console.log "Main: The meaning of life is " + meaningOfLife() |
|||
if not module.parent then main()</lang> |
|||
test.coffee: |
|||
<lang coffeescript>#!/usr/bin/env coffee |
|||
sm = require "./scriptedmain" |
|||
console.log "Test: The meaning of life is " + sm.meaningOfLife()</lang> |
|||
=={{header|Common Lisp}}== |
=={{header|Common Lisp}}== |