docs: Add some documentation about #!

Add the #! syntax to the quickstart guide, and to the tutorial as well.
Fixes #992.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
This commit is contained in:
Gergely Nagy 2015-12-09 11:48:44 +01:00
parent dab75f685d
commit 6d00df3932
2 changed files with 16 additions and 4 deletions

View File

@ -31,13 +31,18 @@ Quickstart
7. Open up an elite programming editor and type::
#! /usr/bin/env hy
(print "I was going to code in Python syntax, but then I got Hy.")
8. Save as ``awesome.hy``.
9. And run your first Hy program::
9. Make it executable::
hy awesome.hy
chmod +x awesome.hy
10. Take a deep breath so as to not hyperventilate.
11. Smile villainously and sneak off to your hydeaway and do
10. And run your first Hy program::
./awesome.hy
11. Take a deep breath so as to not hyperventilate.
12. Smile villainously and sneak off to your hydeaway and do
unspeakable things.

View File

@ -306,6 +306,13 @@ Comments start with semicolons:
; (print "but this will not")
(+ 1 2 3) ; we'll execute the addition, but not this comment!
Hashbang (``#!``) syntax is supported:
.. code-block:: clj
#! /usr/bin/env hy
(print "Make me executable, and run me!")
Looping is not hard but has a kind of special structure. In Python,
we might do::