From 1bdf0d04c33c426221edac69cca17be544fe8ec3 Mon Sep 17 00:00:00 2001 From: Vasudev Kamath Date: Sun, 5 Jan 2014 19:12:19 +0530 Subject: [PATCH] Added documentation for new core function disassemble Signed-off-by: Vasudev Kamath --- docs/language/core.rst | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/language/core.rst b/docs/language/core.rst index c9b67f2..c11672f 100644 --- a/docs/language/core.rst +++ b/docs/language/core.rst @@ -29,6 +29,27 @@ Raises ``TypeError`` if ``(not (numeric? x))``. 11.3 +.. _disassemble-fn: + +disassemble +----------- + +Usage: ``(disassemble tree &optional [codegen false])`` + +Dump the Python AST for given Hy tree to standard output. If codegen +is true function prints Python code instead. + +.. code-block:: clojure + + => (disassemble '(print "Hello World!")) + Module( + body=[ + Expr(value=Call(func=Name(id='print'), args=[Str(s='Hello World!')], keywords=[], starargs=None, kwargs=None))]) + + => (disassemble '(print "Hello World!")) + print('Hello World!') + + .. _emtpy?-fn: empty?