| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| hy-0.28.0.tar.gz | 2024-01-05 | 106.4 kB | |
| 0.28.0 source code.tar.gz | 2024-01-05 | 454.6 kB | |
| 0.28.0 source code.zip | 2024-01-05 | 502.7 kB | |
| README.md | 2024-01-05 | 2.9 kB | |
| Totals: 4 Items | 1.1 MB | 0 | |
Removals
dochas been removed. Use(help (get-macro foo))or(help (get-macro :reader foo))instead.delmacrohas been removed. Use(eval-when-compile (del (get _hy_macros (hy.mangle "foo"))))instead.hy.reservedhas been removed. Use(.keys (builtins._hy_macros))or Python's built-inkeywordmodule instead.- The environment variables
HY_DEBUGandHY_FILTER_INTERNAL_ERRORShave been replaced withHY_SHOW_INTERNAL_ERRORS.
Other Breaking Changes
defmacroandrequirecan now define macros locally instead of only module-wide.- When a macro is
require\d from another module, that module is no longer implicitly included when checking for further macros in the expansion. hy.Mhas been renamed tohy.I.hy.evalhas been overhauled to be more like Python'seval. It also has a new parametermacros.hy.macroexpandandhy.macroexpand-1have been overhauled and generalized to include more of the features ofhy.eval.hynow only implicitly launches a REPL if standard input is a TTY.hy -ihas been overhauled to work as a flag likepython3 -i.hy2pynow requires-mto specify modules, and uses the samesys.pathrules as Python when parsing a module vs a standalone script.- New macro
deftype. - New macro
get-macro. - New macro
local-macros.
New Features
- New syntax
(hy.R.aaa/bbb.m …)for calling the macromfrom the moduleaaa.bbbwithout bringingmoraaa.bbbinto scope. nonlocalnow also works for globally defined names.defn,defn/a, anddefclassnow support type parameters.HyReadernow has an optional parameter to install existing reader macros from the calling module.- New pragma
warn-on-core-shadow.
Misc. Improvements
- Some syntax errors raised by core macros now have more informative messages.
- Logical operators now compile to simpler Python code in some cases.
Bug Fixes
- Implicit returns are now disabled in async generators.
- Fixed parsing of infinite and NaN imaginary literals with an uppercase "J".
- Double quotes inside of bracketed f-strings are now properly handled.
- Fixed incomplete recognition of macro calls with a unary dotted head like
((. defn) f []). ~@ #*now produces a syntax error instead of a nonsensical result.nonlocalnow works for top-levellet-bound names.requirenow warns when you shadow a core macro, likedefmacroalready did.- Fixed
hy.evalfailing ondefreaderorrequireforms that install a new reader. - The parameter
result-okthat was mistakenly included in the signature ofhy.macroexpandis now gone. hy -iwith a filename now skips shebang lines.