The following macros are auto imported into all Hy modules as their base names, such that hy.core.macros.foo
can be called as just foo
.
There are a few core macros that are unusual in that all they do, when expanded, is crash, regardless of their arguments:
else
except
except*
finally
unpack-mapping
unquote
unquote-splice
The purpose of these macros is merely to reserve their names. Each symbol is interpreted specially by one or more other core macros (e.g., else
in while
) and thus, in these contexts, any definition of these names as a function or macro would be ignored. If you really want to, you can override these names like any others, but beware that, for example, trying to call your new else
inside while
may not work.
The hy
module is auto imported into every Hy module and provides convient access to the following methods
Like regular macros, reader macros should return a Hy form that will then be passed to the compiler for execution. Reader macros access the Hy reader using the &reader
name. It gives access to all of the text- and form-parsing logic that Hy uses to parse itself. See :pyHyReader <hy.reader.hy_reader.HyReader>
and its base class :pyReader <hy.reader.reader.Reader>
for details regarding the available processing methods.
hy.reader.hy_reader.HyReader
hy.reader.reader.Reader