hy/docs/language
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
..
api.rst Make fn work like lambda and remove lambda (#1228) 2017-02-22 17:36:52 -06:00
cli.rst Doc: CLI: mention --spy only works in REPL mode. (#1097) 2016-09-22 15:20:26 +03:00
core.rst Remove let from documentation 2017-02-13 09:12:21 -08:00
index.rst Docs: Hy <-> Python interop fix #1061 (#1218) 2017-02-10 17:11:21 -08:00
internals.rst Add bytestring literals 2017-02-19 09:04:45 +02:00
interop.rst Docs: Hy <-> Python interop fix #1061 (#1218) 2017-02-10 17:11:21 -08:00
readermacros.rst Fixes to language documentation 2014-12-06 15:46:44 -08:00