hy/docs/quickstart.rst

44 lines
1.0 KiB
ReStructuredText
Raw Normal View History

2013-04-05 22:30:12 +02:00
==========
Quickstart
==========
.. image:: _static/cuddles-transparent-small.png
2013-06-02 04:02:52 +02:00
:alt: Karen Rustard's Cuddles
(Thanks to Karen Rustad for Cuddles!)
2013-06-02 04:02:52 +02:00
**HOW TO GET HY REAL FAST**:
2013-04-05 22:30:12 +02:00
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::
2013-04-05 22:30:12 +02:00
=> (print "Hy!")
Hy!
=> (defn salutationsnm [name] (print (+ "Hy " name "!")))
2013-04-05 22:30:12 +02:00
=> (salutationsnm "YourName")
Hy YourName!
etc
6. Hit CTRL-D when you're done.
2013-04-05 22:30:12 +02:00
*OMG! That's amazing! I want to write a Hy program.*
2013-04-05 22:30:12 +02:00
7. Open up an elite programming editor and type::
2013-04-05 22:30:12 +02:00
(print "I was going to code in Python syntax, but then I got Hy.")
2013-04-05 22:30:12 +02:00
8. Save as ``awesome.hy``.
9. And run your first Hy program::
2013-04-06 03:27:30 +02:00
hy awesome.hy
2013-04-06 03:38:18 +02:00
10. Take a deep breath so as to not hyperventilate.
11. Smile villainously and sneak off to your hydeaway and do
unspeakable things.