Commit Graph

7 Commits

Author SHA1 Message Date
gilch
497e929913 generalize #% to arbitrary expressions 2017-10-26 14:23:25 -06:00
gilch
b5f1136ba5 %* %** parameters for #% tag macro 2017-10-26 13:03:01 -06:00
gilch
f81fb771eb change xi macro to #% tag macro 2017-10-26 12:55:48 -06:00
Kodi Arfer
484daafa53 Move hy.core.reserved to hy.extra.reserved (#1231)
It was an odd one out by being in hy.core but needing to be called by a qualified name. It's at home in hy.extra.
2017-03-02 16:49:32 -06:00
Kodi Arfer
e4a7b317e1 Make fn work like lambda and remove lambda (#1228)
* with-decorator: Allow a `setv` form as the form to be decorated

This feature is of dubious value by itself, but it's necessary to allow `defn` to create a lambda instead of a `def`.

* Make `fn` work the same as `lambda`

That is, allow it to generate a `lambda` instead of a `def` statement if the function body is just an expression.

I've removed two uses of with_decorator in hy.compiler because they'd require adding another case to HyASTCompiler.compile_decorate_expression and they have no ultimate effect, anyway.

In a few tests, I've added a meaningless statement in `fn` bodies to force generation of a `def`.

I've removed `test_fn_compiler_empty_function` rather than rewrite it because it seems like a pain to maintain and not very useful.

* Remove `lambda`, now that `fn` does the same thing
2017-02-22 17:36:52 -06:00
Kodi Arfer
8eceb4fe9d Move contrib.anaphoric to contrib.extra 2016-12-29 08:35:41 -08:00
Kodi Arfer
670c5ae7e5 Add hy.extra 2016-12-26 15:39:26 -08:00