Examples
~~~~~~~~~~~
-.. code:: ipython2
+.. code:: python
joy.parser.text_to_expression('1 2 3 4 5') # A simple sequence.
(1, (2, (3, (4, (5, ())))))
-.. code:: ipython2
+.. code:: python
joy.parser.text_to_expression('[1 2 3] 4 5') # Three items, the first is a list with three items
((1, (2, (3, ()))), (4, (5, ())))
-.. code:: ipython2
+.. code:: python
joy.parser.text_to_expression('1 23 ["four" [-5.0] cons] 8888') # A mixed bag. cons is
# a Symbol, no lookup at
-.. code:: ipython2
+.. code:: python
joy.parser.text_to_expression('[][][][][]') # Five empty lists.
-.. code:: ipython2
+.. code:: python
joy.parser.text_to_expression('[[[[[]]]]]') # Five nested lists.
Many of the functions are defined in Python, like ``dip``:
-.. code:: ipython2
+.. code:: python
print inspect.getsource(joy.library.dip)
pushes its body expression onto the pending expression (the
continuation) and returns control to the interpreter.
-.. code:: ipython2
+.. code:: python
print joy.library.definitions