commit
addf9c4a01
@ -9,7 +9,7 @@ python:
|
|||||||
- pypy3
|
- pypy3
|
||||||
install:
|
install:
|
||||||
- pip install -r requirements-travis.txt
|
- pip install -r requirements-travis.txt
|
||||||
- pip install --process-dependency-links -e .
|
- pip install -e .
|
||||||
script: pytest
|
script: pytest
|
||||||
cache: pip
|
cache: pip
|
||||||
after_success: make coveralls
|
after_success: make coveralls
|
||||||
|
83
NEWS.rst
83
NEWS.rst
@ -1,20 +1,20 @@
|
|||||||
.. default-role:: code
|
.. default-role:: code
|
||||||
|
|
||||||
Unreleased
|
0.15.0
|
||||||
==============================
|
==============================
|
||||||
|
|
||||||
Removals
|
Removals
|
||||||
------------------------------
|
------------------------------
|
||||||
* Dotted lists, `HyCons`, `cons`, `cons?`, and `list*` have been removed.
|
* Dotted lists, `HyCons`, `cons`, `cons?`, and `list*` have been
|
||||||
These were redundant with Python's built-in data structures and Hy's most
|
removed. These were redundant with Python's built-in data structures
|
||||||
common model types (`HyExpression`, `HyList`, etc.).
|
and Hy's most common model types (`HyExpression`, `HyList`, etc.).
|
||||||
* `&key` is no longer special in lambda lists. Use `&optional` instead.
|
* `&key` is no longer special in lambda lists. Use `&optional` instead.
|
||||||
* Tuple unpacking is no longer built into special forms for function
|
* Lambda lists can no longer unpack tuples.
|
||||||
definition (`fn` etc.)
|
* `ap-pipe` and `ap-compose` have been removed. Use threading macros and
|
||||||
* Macros `ap-pipe` and `ap-compose` have been removed.
|
`comp` instead.
|
||||||
Anaphoric macros do not work well with point-free style programming,
|
|
||||||
in which case both threading macros and `comp` are more adequate.
|
|
||||||
* `for/a` has been removed. Use `(for [:async ...] ...)` instead.
|
* `for/a` has been removed. Use `(for [:async ...] ...)` instead.
|
||||||
|
* `(except)` is no longer allowed. Use `(except [])` instead.
|
||||||
|
* `(import [foo])` is no longer allowed. Use `(import foo)` instead.
|
||||||
|
|
||||||
Other Breaking Changes
|
Other Breaking Changes
|
||||||
------------------------------
|
------------------------------
|
||||||
@ -22,58 +22,57 @@ Other Breaking Changes
|
|||||||
This means you can no longer use alternative punctuation in place of
|
This means you can no longer use alternative punctuation in place of
|
||||||
square brackets in special forms (e.g. `(fn (x) ...)` instead of
|
square brackets in special forms (e.g. `(fn (x) ...)` instead of
|
||||||
the standard `(fn [x] ...)`).
|
the standard `(fn [x] ...)`).
|
||||||
* Mangling rules have been overhauled, such that mangled names
|
* Mangling rules have been overhauled; now, mangled names are
|
||||||
are always legal Python identifiers
|
always legal Python identifiers.
|
||||||
* `_` and `-` are now equivalent even as single-character names
|
* `_` and `-` are now equivalent, even as single-character names.
|
||||||
|
|
||||||
* The REPL history variable `_` is now `*1`
|
* The REPL history variable `_` is now `*1`.
|
||||||
|
|
||||||
* Non-shadow unary `=`, `is`, `<`, etc. now evaluate their argument
|
* Non-shadow unary `=`, `is`, `<`, etc. now evaluate their argument
|
||||||
instead of ignoring it. This change increases consistency a bit
|
instead of ignoring it.
|
||||||
and makes accidental unary uses easier to notice.
|
|
||||||
* `list-comp`, `set-comp`, `dict-comp`, and `genexpr` have been replaced
|
* `list-comp`, `set-comp`, `dict-comp`, and `genexpr` have been replaced
|
||||||
by `lfor`, `sfor`, `dfor`, and `gfor`, respectively, which use a new
|
by `lfor`, `sfor`, `dfor`, and `gfor`, respectively, which use a new
|
||||||
syntax and have additional features. All Python comprehensions can now
|
syntax and have additional features. All Python comprehensions can now
|
||||||
be written in Hy.
|
be written in Hy.
|
||||||
* `hy-repr` uses registered functions instead of methods
|
|
||||||
* `HyKeyword` no longer inherits from the string type and has been
|
|
||||||
made into its own object type.
|
|
||||||
* `HySymbol` no longer inherits from `HyString`.
|
|
||||||
* `(except)` is no longer allowed. Use `(except [])` instead.
|
|
||||||
* `(import [foo])` is no longer allowed. Use `(import foo)` instead.
|
|
||||||
* `&`-parameters in lambda lists must now appear in the same order that
|
* `&`-parameters in lambda lists must now appear in the same order that
|
||||||
Python expects.
|
Python expects.
|
||||||
|
* Literal keywords now evaluate to themselves, and `HyKeyword` no longer
|
||||||
|
inherits from a Python string type
|
||||||
|
* `HySymbol` no longer inherits from `HyString`.
|
||||||
|
|
||||||
New Features
|
New Features
|
||||||
------------------------------
|
------------------------------
|
||||||
* Python 3.7 is now supported
|
* Python 3.7 is now supported.
|
||||||
* Added `mangle` and `unmangle` as core functions
|
* `while` and `for` are allowed to have empty bodies.
|
||||||
* More REPL history result variables: `*2`, `*3`. Added last REPL error
|
* `for` supports the various new clause types offered by `lfor`.
|
||||||
variable: `*e`
|
* `defclass` in Python 3 supports specifying metaclasses and other
|
||||||
* `defclass` in Python 3 now supports specifying metaclasses and other
|
keyword arguments.
|
||||||
keyword arguments
|
* Added `mangle` and `unmangle` as core functions.
|
||||||
* Added a command-line option `-E` per CPython
|
* Added more REPL history variables: `*2` and `*3`.
|
||||||
* `while` and `for` are allowed to have empty bodies
|
* Added a REPL variable holding the last exception: `*e`.
|
||||||
* `for` supports the various new clause types offered by `lfor`
|
* Added a command-line option `-E` per CPython.
|
||||||
* Added a new module ``hy.model_patterns``
|
* Added a new module `hy.model_patterns`.
|
||||||
* `defmacro!` now allows optional args
|
|
||||||
|
|
||||||
Bug Fixes
|
Bug Fixes
|
||||||
------------------------------
|
------------------------------
|
||||||
* `hy2py` should now output legal Python code equivalent to the input Hy
|
* `hy2py` should now output legal Python code equivalent to the input Hy
|
||||||
code in all cases, modulo some outstanding bugs in `astor`
|
code in all cases.
|
||||||
* Fix `(return)` so it works correctly to exit a Python 2 generator
|
* Fixed `(return)` so it can exit a Python 2 generator.
|
||||||
* Fixed a case where `->` and `->>` duplicated an argument
|
* Fixed a case where `->` and `->>` duplicated an argument.
|
||||||
* Fixed bugs that caused `defclass` to drop statements or crash
|
* Fixed bugs that caused `defclass` to drop statements or crash.
|
||||||
* Fixed a REPL crash caused by illegle unicode escape string inputs
|
* Fixed a REPL crash caused by illegal backslash escapes.
|
||||||
* `NaN` can no longer create an infinite loop during macro-expansion
|
* `NaN` can no longer create an infinite loop during macro-expansion.
|
||||||
* Fixed a bug that caused `try` to drop expressions
|
* Fixed a bug that caused `try` to drop expressions.
|
||||||
* Fixed a bug where the compiler didn't properly compile `unquote-splice`
|
* The compiler now properly recognizes `unquote-splice`.
|
||||||
* Trying to import a dotted name is now a syntax error, as in Python
|
* Trying to import a dotted name is now a syntax error, as in Python.
|
||||||
|
* `defmacro!` now allows optional arguments.
|
||||||
|
* Fixed handling of variables that are bound multiple times in a single
|
||||||
|
`let`.
|
||||||
|
|
||||||
Misc. Improvements
|
Misc. Improvements
|
||||||
----------------------------
|
----------------------------
|
||||||
* `hy-repr` supports more standard types
|
* `hy-repr` uses registered functions instead of methods.
|
||||||
|
* `hy-repr` supports more standard types.
|
||||||
|
|
||||||
0.14.0
|
0.14.0
|
||||||
==============================
|
==============================
|
||||||
|
5
setup.py
5
setup.py
@ -30,7 +30,7 @@ class Install(install):
|
|||||||
"." + filename[:-len(".hy")])
|
"." + filename[:-len(".hy")])
|
||||||
install.run(self)
|
install.run(self)
|
||||||
|
|
||||||
install_requires = ['rply>=0.7.6', 'astor', 'funcparserlib>=0.3.6', 'clint>=0.4']
|
install_requires = ['rply>=0.7.6', 'astor>=0.7.1', 'funcparserlib>=0.3.6', 'clint>=0.4']
|
||||||
if os.name == 'nt':
|
if os.name == 'nt':
|
||||||
install_requires.append('pyreadline>=2.1')
|
install_requires.append('pyreadline>=2.1')
|
||||||
|
|
||||||
@ -40,9 +40,6 @@ setup(
|
|||||||
name=PKG,
|
name=PKG,
|
||||||
version=__version__,
|
version=__version__,
|
||||||
install_requires=install_requires,
|
install_requires=install_requires,
|
||||||
dependency_links=[
|
|
||||||
'git+https://github.com/berkerpeksag/astor.git#egg=astor-0.7.0'
|
|
||||||
],
|
|
||||||
cmdclass=dict(install=Install),
|
cmdclass=dict(install=Install),
|
||||||
entry_points={
|
entry_points={
|
||||||
'console_scripts': [
|
'console_scripts': [
|
||||||
|
@ -29,6 +29,11 @@ Call me Ishmael. Some years ago—never mind how long precisely—having little
|
|||||||
(setv myset #{4 5 6})
|
(setv myset #{4 5 6})
|
||||||
(setv mydict {7 8 9 900 10 15})
|
(setv mydict {7 8 9 900 10 15})
|
||||||
|
|
||||||
|
(setv emptylist [])
|
||||||
|
(setv emptytuple (,))
|
||||||
|
(setv emptyset #{})
|
||||||
|
(setv emptydict {})
|
||||||
|
|
||||||
(setv mylistcomp (lfor x (range 10) :if (% x 2) x))
|
(setv mylistcomp (lfor x (range 10) :if (% x 2) x))
|
||||||
(setv mysetcomp (sfor x (range 5) :if (not (% x 2)) x))
|
(setv mysetcomp (sfor x (range 5) :if (not (% x 2)) x))
|
||||||
(setv mydictcomp (dfor k "abcde" :if (!= k "c") [k (.upper k)]))
|
(setv mydictcomp (dfor k "abcde" :if (!= k "c") [k (.upper k)]))
|
||||||
|
@ -53,6 +53,11 @@ def assert_stuff(m):
|
|||||||
assert m.myset == {4, 5, 6}
|
assert m.myset == {4, 5, 6}
|
||||||
assert m.mydict == {7: 8, 9: 900, 10: 15}
|
assert m.mydict == {7: 8, 9: 900, 10: 15}
|
||||||
|
|
||||||
|
assert m.emptylist == []
|
||||||
|
assert m.emptytuple == ()
|
||||||
|
assert m.emptyset == set()
|
||||||
|
assert m.emptydict == {}
|
||||||
|
|
||||||
assert m.mylistcomp == [1, 3, 5, 7, 9]
|
assert m.mylistcomp == [1, 3, 5, 7, 9]
|
||||||
assert m.mysetcomp == {0, 2, 4}
|
assert m.mysetcomp == {0, 2, 4}
|
||||||
assert m.mydictcomp == dict(a="A", b="B", d="D", e="E")
|
assert m.mydictcomp == dict(a="A", b="B", d="D", e="E")
|
||||||
|
Loading…
Reference in New Issue
Block a user