Multiline shebang: Difference between revisions

Content added Content deleted
m (added whitespace before the TOC.)
(→‎{{header|Nim}}: Rescued OCaml entry which had become tangled up with Nim.)
Line 389: Line 389:
In Nim, multiline comments start with <code>#[</code> and end with <code>]#</code>. This allows to build a polyglot program which can be run as a shell script and compiled as a Nim program.
In Nim, multiline comments start with <code>#[</code> and end with <code>]#</code>. This allows to build a polyglot program which can be run as a shell script and compiled as a Nim program.


<Lang Nim>#!/bin/bash
<lang Nim>#!/bin/bash
#[
#[
echo Put here code to run as a shell script.
echo Put here code to run as a shell script.
Line 396: Line 396:


# Nim program
# Nim program
echo "Executing Nim program"
echo "Executing Nim program"</lang>


=={{header|OCaml}}==
=={{header|OCaml}}==