Commit Graph

18 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 cfbc45a586 Test that `ap-each` returns `None` 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 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 592c681261 Clean up native-tests.extra.anaphoric 2019-12-15 14:55:31 -05:00
Kodi Arfer 62638b44a3 Update copyright years 2019-02-07 08:57:35 -05: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 2b11b9be20 Automatically read and write bytecode
Importing or executing a Hy file now loads the byte-compiled version if it exists and is up to date, and if not, the source is byte-compiled after it's parsed.

This change can speed up Hy a lot. Here are some examples comparing run times of the current master (491b474e) to this commit, on my laptop with Python 3.6:

- `nosetests --exclude='test_bin'` goes from 3.8 s to 0.7 s (a 5-fold speedup)
- `hy -c '(print "hello world")` goes from 0.47 s to 0.20 s (a 2-fold speedup)
- Rogue TV's startup goes from 3.6 s to 0.4 s (a 9-fold speedup)

Accompanying changes include:

- `setup.py` now creates and installs bytecode for `hy.core`, `hy.contrib`, and `hy.extra`.
- The `hyc` command under Python 3 now creates bytecode in `__pycache__`, as usual for Python 3, instead of putting the `.pyc` right next to the source file like Python 2 does.

I've removed a test of `hy.extra.anaphoric.a-if` that triggers #1268 when the test file is byte-compiled and then hits some weird `macroexpand` bug or something when I try to work around that—Nose crashes when trying to produce an error message, and I can't seem to replicate the bug without Nose.
2017-04-14 13:38:33 -07:00
Kodi Arfer d72abb39f1 Remove uses of `let` from various tests 2017-02-04 09:07:27 -08:00
Kodi Arfer 8eceb4fe9d Move contrib.anaphoric to contrib.extra 2016-12-29 08:35:41 -08:00