Modulinos: Difference between revisions
Content added Content deleted
m (→{{header|Phix}}: now builtin) |
Thundergnat (talk | contribs) (Rename Perl 6 -> Raku, alphabetize, minor clean-up) |
||
Line 1,274: | Line 1,274: | ||
print "Life means " . Life::meaning_of_life . ".\n"; |
print "Life means " . Life::meaning_of_life . ".\n"; |
||
print "Death means invisible scary skeletons.\n";</lang> |
print "Death means invisible scary skeletons.\n";</lang> |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
=={{header|Phix}}== |
=={{header|Phix}}== |
||
Line 1,363: | Line 1,350: | ||
print("Life means %s." % meaning_of_life()) |
print("Life means %s." % meaning_of_life()) |
||
print("Death means invisible scary skeletons.")</lang> |
print("Death means invisible scary skeletons.")</lang> |
||
=={{header|R}}== |
=={{header|R}}== |
||
A way to check if code is running at "top level" is to check <code>length(sys.frames())</code>. This value will be zero for a file being run with <code>Rscript</code>, the <code>--file=</code> argument, or at the command line, and will be greater than 0 in all other conditions (such as package loading or code being sourced from another file.) |
A way to check if code is running at "top level" is to check <code>length(sys.frames())</code>. This value will be zero for a file being run with <code>Rscript</code>, the <code>--file=</code> argument, or at the command line, and will be greater than 0 in all other conditions (such as package loading or code being sourced from another file.) |
||
Line 1,410: | Line 1,398: | ||
(require "scriptedmain.rkt") |
(require "scriptedmain.rkt") |
||
(printf "Test: The meaning of life is ~a\n" (meaning-of-life)))</lang> |
(printf "Test: The meaning of life is ~a\n" (meaning-of-life)))</lang> |
||
⚫ | |||
(formerly Perl 6) |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
=={{header|REXX}}== |
=={{header|REXX}}== |
||
Line 1,572: | Line 1,575: | ||
$ ./test |
$ ./test |
||
Test: The meaning of life is 42</lang> |
Test: The meaning of life is 42</lang> |
||
=={{header|Scala}}== |
=={{header|Scala}}== |
||
{{libheader|Scala}} |
{{libheader|Scala}} |
||
Line 1,726: | Line 1,730: | ||
Transcript show: 'Test: The meaning of life is ', ((ScriptedMain meaningOfLife) printString); cr.</lang> |
Transcript show: 'Test: The meaning of life is ', ((ScriptedMain meaningOfLife) printString); cr.</lang> |
||
=={{header|Swift}}== |
=={{header|Swift}}== |