This changes with syntax from (with [[x (expr)] (expr)] ...) to (with
[x (expr) (expr)] ...). Should have no ill side effects apart from the
syntax change.
Closes#852.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
This changes let to use a flat list of symbol-value pairs instead of a
vector of vectors. One side effect is that (let [[a 1] z]) is not
expressible now, and one will explicitly need to set a nil value for z,
such as: (let [a 1 z nil]).
Closes#713.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Expressions can sometimes contain itertools.islice objects, which we can
only walk if we force them into a list. To do this, the walk function
has to be taught that collections that are not instances of list should
be forced into a list.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
This function will recursively perform all possible macroexpansions in
the supplied form. Unfortunately, it also traverses into quasiquoted
parts, where it shouldn't, but it is a useful estimation of macro
expansion anyway.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
The hy.contrib.walk module provides a few functions to walk the Hy AST,
and potentially transform it along the way. The main entry point
is (walk), which takes two functions and a form as arguments, and
applies the first (inner) function to each element of the form, building
up a data structure of the same type as the original. Then applies outer
(the second function) to the result.
Two convenience functions are provided: (postwalk) and (prewalk), which
do a depth-first, post/pre-order traversal of the form.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>