Commit Graph

21 Commits

Author SHA1 Message Date
Joseph Egan f1de9050ea Reduce scope of symbol replacement for anaphoric macros 2020-03-31 11:18:48 -04:00
Kodi Arfer 80eb27906a Update copyright years 2020-01-09 14:05:12 -05:00
Kodi Arfer 08abdd5af9 Delete `anaphoric` docstrings
so they don't get desynchronized from the manual.
2019-12-21 14:36:25 -05:00
Kodi Arfer bbb7426269 Rationalize `anaphoric` parameter names 2019-12-21 14:36:25 -05:00
Kodi Arfer e57bbb92db Use a gensym for `it` in anaphoric macros 2019-12-21 14:36:25 -05:00
Kodi Arfer bafd919605 Clean up the implementations of anaphoric macros 2019-12-21 14:36:24 -05:00
Kodi Arfer b12c930444 Allow non-constant `n` in `ap-dotimes` 2019-12-21 11:10:30 -05:00
Kodi Arfer f6b9ba9b8f Fix some bugs in `ap-reduce` 2019-12-15 14:55:31 -05:00
Kodi Arfer 62638b44a3 Update copyright years 2019-02-07 08:57:35 -05:00
Kodi Arfer cf0dafef9b Update uses of the old comprehension forms 2018-06-13 17:31:08 -07:00
Philip Xu 8a83d0c1ea Fixes #1605: remove macros ap-pipe and ap-compose
Anaphoric macros do not work well with point-free style programming, in
which case both threading macros and `comp` are more adequate.
2018-05-20 13:52:51 -07:00
Kodi Arfer 6de7ddfee5 Update copyright years 2018-01-01 10:38:33 -05:00
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
gilch 2319adcc7f fix whitespace in anaphoric 2017-10-26 12:53:08 -06:00
Kodi Arfer 2eb81864df Make all files comply with license-header policy 2017-04-27 14:16:57 -07:00
Kodi Arfer 8b6a45e43a Remove `car` and `cdr` in favor of `first` and `rest` (#1241)
* Remove uses of `car` and `cdr` in /hy

* Remove uses of `car` and `cdr` in quote tests

* Remove `car` and `cdr` in favor of `first` and `rest`

I beefed up the documentation and tests for `first` and `rest` while I was at it.

I defined `car` and `cdr` in native_tests.cons so the tests read a bit more naturally.
2017-03-06 10:34:40 -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 99638ba2df Remove uses of `let` from /hy 2017-02-03 17:06:26 -08:00
Kodi Arfer 8eceb4fe9d Move contrib.anaphoric to contrib.extra 2016-12-29 08:35:41 -08:00