0.14.0
Removals
* Python 3.3 is no longer supported
* def is gone; use setv instead
* apply is gone; use the new #* and #** syntax instead
* yield-from is no longer supported under Python 2
* Periods are no longer allowed in keywords
* Numeric literals can no longer begin with a comma or underscore
* Literal Inf\s and NaN\s must now be capitalized like that
Other Breaking Changes
* Single-character "sharp macros" are now "tag macros", which can have
longer names
* xi from hy.extra.anaphoric is now a tag macro #%
* eval is now a function instead of a special form
New Features
* The compiler now automatically promotes values to Hy model objects
as necessary, so you can write (eval (+ 1 ~n)) instead of
(eval (+ 1 ~(HyInteger n)))
* return has been implemented as a special form
* Added a form of string literal called "bracket strings" delimited by
#[FOO[ and ]FOO], where FOO is customizable
* Added support for PEP 492 (async and await) with fn/a, defn/a,
with/a, and for/a
* Added Python-style unpacking operators #* and #** (e.g.,
(f #* args #** kwargs))
* Added a macro comment
* Added EDN #_ syntax to discard the next term
* while loops may now contain an else clause, like for loops
* #% works on any expression and has a new &kwargs parameter %**
* Added a macro doc and a tag macro #doc
* get is available as a function
* ~@ (unquote-splice) form now accepts any false value as empty
Bug Fixes
* Relative imports (PEP 328) are now allowed
* Numeric literals are no longer parsed as symbols when followed by a dot
and a symbol
* Hy now respects the environment variable PYTHONDONTWRITEBYTECODE
* String literals should no longer be interpreted as special forms or macros
* Tag macros (née sharp macros) whose names begin with ! are no longer
mistaken for shebang lines
* Fixed a bug where REPL history wasn't saved if you quit the REPL with
(quit) or (exit)
* exec now works under Python 2
* No TypeError from multi-arity defn returning values evaluating to None
* try forms are now possible in defmacro and deftag
* Multiple expressions are now allowed in try
* Fixed a crash when macroexpand\ing a macro with a named import
* Fixed a crash when with suppresses an exception. with now returns
None in this case.
* Fixed a crash when --repl-output-fn raises an exception
* Fixed a crash when HyTypeError was raised with objects that had no
source position
* assoc now evaluates its arguments only once each
* Multiple expressions are now allowed in the else clause of
a for loop
* else clauses in for and while are recognized more reliably
* Statements in the condition of a while loop are repeated properly
* Argument destructuring no longer interferes with function docstrings
* Nullary yield-from is now a syntax error
* break and continue now raise an error when given arguments
instead of silently ignoring them
Misc. Improvements
* read, read_str, and eval are exposed and documented as top-level
functions in the hy module
* An experimental let macro has been added to hy.contrib.walk
Changes 0.13.1:
[ Language Changes ]
* Pythons 2.6, 3.0, 3.1, and 3.2 are no longer supported
* let has been removed. Python's scoping rules do not make a proper
implementation of it possible. Use setv instead.
* lambda has been removed, but fn now does exactly what lambda did
* defreader has been renamed to defsharp; what were previously called
"reader macros", which were never true reader macros, are now called
"sharp macros"
* try now enforces the usual Python order for its elements (else must
follow all excepts, and finally must come last). This is only a
syntactic change; the elements were already run in Python order even when
defined out of order.
* try now requires an except or finally clause, as in Python
* Importing or executing a Hy file automatically byte-compiles it, or loads
a byte-compiled version if it exists and is up to date. This brings big
speed boosts, even for one-liners, because Hy no longer needs to recompile
its standard library for every startup.
* Added bytestring literals, which create bytes objects under Python 3
and str objects under Python 2
* Commas and underscores are allowed in numeric literals
* Many more operators (e.g., **, //, not, in) can be used
as first-class functions
* The semantics of binary operators when applied to fewer or more
than two arguments have been made more logical
* (** a b c d) is now equivalent to (** a (** b (** c d))),
not (** (** (** a b) c) d)
* setv always returns None
* When a try form executes an else clause, the return value for the
try form is taken from else instead of the try body. For example,
(try 1 (except [ValueError] 2) (else 3)) returns 3.
* xor: If exactly one argument is true, return it
* hy.core.reserved is now hy.extra.reserved
* cond now supports single argument branches
[ Bug Fixes ]
* All shadowed operators have the same arities as real operators
* Shadowed comparison operators now use and instead of &
for chained comparisons
* partition no longer prematurely exhausts input iterators
* read and read-str no longer raise an error when the input
parses to a false value (e.g., the empty string)
* A yield inside of a with statement will properly suppress implicit
returns
* setv no longer unnecessarily tries to get attributes
* loop no longer replaces string literals equal to "recur"
* The REPL now prints the correct value of do and try forms
* Fixed a crash when tokenizing a single quote followed by whitespace
[ Misc. Improvements ]
* New contrib module hy-repr
* Added a command-line option --repl-output-fn