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
doc
has been removed. Use(help (get-macro foo))
or(help (get-macro :reader foo))
instead.delmacro
has been removed. Use(eval-when-compile (del (get _hy_macros (hy.mangle "foo"))))
instead.hy.reserved
has been removed. Use(.keys (builtins._hy_macros))
or Python's built-inkeyword
module instead.- The environment variables
HY_DEBUG
andHY_FILTER_INTERNAL_ERRORS
have been replaced withHY_SHOW_INTERNAL_ERRORS
.
Other Breaking Changes
defmacro
andrequire
can 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.M
has been renamed tohy.I
.hy.eval
has been overhauled to be more like Python'seval
. It also has a new parametermacros
.hy.macroexpand
andhy.macroexpand-1
have been overhauled and generalized to include more of the features ofhy.eval
.hy
now only implicitly launches a REPL if standard input is a TTY.hy -i
has been overhauled to work as a flag likepython3 -i
.hy2py
now requires-m
to specify modules, and uses the samesys.path
rules 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 macrom
from the moduleaaa.bbb
without bringingm
oraaa.bbb
into scope. nonlocal
now also works for globally defined names.defn
,defn/a
, anddefclass
now support type parameters.HyReader
now 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.nonlocal
now works for top-levellet
-bound names.require
now warns when you shadow a core macro, likedefmacro
already did.- Fixed
hy.eval
failing ondefreader
orrequire
forms that install a new reader. - The parameter
result-ok
that was mistakenly included in the signature ofhy.macroexpand
is now gone. hy -i
with a filename now skips shebang lines.