github hylang/hy 1.0a1

latest releases: 0.24.0, 1.0a4, 1.0a3...
3 years ago

Removals

  • The core function name has been removed.
    Use unmangle or the name attribute of keyword objects instead.
  • deftag has been removed. Instead of (deftag foo …),
    say (defmacro "#foo" …).
  • #doc has been removed. Instead of #doc @, say (doc "#@").
  • __tags__ has been removed. Tag macros are now tracked in
    __macros__.

Other Breaking Changes

  • Lambda lists (function parameter lists) have been simplified.
    &optional is gone, &args is #*, &kwargs is #**, and
    &kwonly is *. Thus, [a &optional b [c 3] &rest args &kwargs kwargs] is now [a [b None] [c 3] #* args #** kwargs].
  • Hy models have been renamed to remove "Hy", and are no longer
    automatically brought into scope. Thus, HyList is now
    hy.models.List.
  • eval is no longer automatically brought into scope. Call it as
    hy.eval (or import it explicitly).
  • Calling a keyword object now does a string lookup, instead of a
    keyword-object lookup. Thus, (:key obj) is equivalent to (get obj (mangle (. :key name))).
  • To require a tag macro foo, instead of (require [module [foo]]),
    you must now say (require [module ["#foo"]]).
  • Mangling no longer converts leading hyphens to underscores, and
    unmangling no longer converts leading underscores to hyphens.
  • F-strings now have their own model type, and store their code parts
    as models instead of strings.

New Features

  • Python 3.10 is now supported.
  • Lambda lists now support positional-only arguments.
  • F-strings now support = syntax per Python.
  • with now supports unnamed context managers.
  • defmacro and require can now take macro names as string
    literals.
  • New standard macros do-n, list-n, and cfor.
  • The location of the REPL history file can now be set with the
    environment variable HY_HISTORY.
  • REPL initialization scripts are now supported with the envrionment
    variable HYSTARTUP.
  • The module hy.extra.reserved has a new function special.
  • New module hy.contrib.destructure for Clojure-style destructuring.
  • New module hy.contrib.slicing for multi-index sequence slicing.

Bug Fixes

  • Fixed the identifier J being incorrectly parsed as a complex
    number.
  • Attempts to assign to constants are now more reliably detected.
  • Fixed a bug where AST nodes from macro expansion did not properly
    receive source locations.
  • Fixed doc sometimes failing to find core macros.
  • doc now works with names that need mangling.
  • Fixed bugs with require of names that need mangling.
  • Fixed a compiler crash from trying to use .. as an operator.
  • Fixed namespace pollution caused by automatic imports of Hy builtins
    and macros.
  • require now works with relative imports and can name modules as
    members, as in (require [hy.contrib [walk]]).
  • Fixed error handling for illegal macro names.
  • Fixed hyc and hy2py not finding relative imports.
  • Fixed hy.contrib.walk.smacrolet requiring a module name.

Misc. Improvements

  • The library astor is no longer required on Pythons ≥ 3.9.

Don't miss a new hy release

NewReleases is sending notifications on new releases.