hy/docs/quickstart.rst
Gergely Nagy 6d00df3932 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>
2015-12-09 11:48:44 +01:00

49 lines
1.1 KiB
ReStructuredText

==========
Quickstart
==========
.. image:: _static/cuddles-transparent-small.png
:alt: Karen Rustard's Cuddles
(Thanks to Karen Rustad for Cuddles!)
**HOW TO GET HY REAL FAST**:
1. Create a `Virtual Python Environment
<https://pypi.python.org/pypi/virtualenv>`_.
2. Activate your Virtual Python Environment.
3. Install `hy from PyPI <https://pypi.python.org/pypi/hy>`_ with ``pip install hy``.
4. Start a REPL with ``hy``.
5. Type stuff in the REPL::
=> (print "Hy!")
Hy!
=> (defn salutationsnm [name] (print (+ "Hy " name "!")))
=> (salutationsnm "YourName")
Hy YourName!
etc
6. Hit CTRL-D when you're done.
*OMG! That's amazing! I want to write a Hy program.*
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. Make it executable::
chmod +x awesome.hy
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.