Merge branch 'kirbyfan64-yield-ret'
This commit is contained in:
commit
61f4277104
32
NEWS
32
NEWS
@ -17,6 +17,8 @@ Changes from 0.12.1
|
|||||||
* partition no longer prematurely exhausts input iterators
|
* partition no longer prematurely exhausts input iterators
|
||||||
* read and read-str no longer raise an error when the input
|
* read and read-str no longer raise an error when the input
|
||||||
parses to a false value (e.g., the empty string)
|
parses to a false value (e.g., the empty string)
|
||||||
|
* A `yield` inside of a `with` statement will properly suppress implicit
|
||||||
|
returns.
|
||||||
|
|
||||||
Changes from 0.12.0
|
Changes from 0.12.0
|
||||||
|
|
||||||
@ -163,7 +165,7 @@ Changes from 0.10.0
|
|||||||
* doto macro added
|
* doto macro added
|
||||||
* keyword? to find out keywords
|
* keyword? to find out keywords
|
||||||
* setv no longer allows "." in names
|
* setv no longer allows "." in names
|
||||||
|
|
||||||
[Internals ]
|
[Internals ]
|
||||||
* Builtins reimplemented in terms of python stdlib
|
* Builtins reimplemented in terms of python stdlib
|
||||||
* gensyms (defmacro/g!) handles non-string types better
|
* gensyms (defmacro/g!) handles non-string types better
|
||||||
@ -190,12 +192,12 @@ Changes from 0.9.12
|
|||||||
- Hy Society
|
- Hy Society
|
||||||
|
|
||||||
[ Breaking Changes ]
|
[ Breaking Changes ]
|
||||||
|
|
||||||
We're calling this release 0.10 because we broke
|
We're calling this release 0.10 because we broke
|
||||||
API. Sorry about that. We've removed kwapply in
|
API. Sorry about that. We've removed kwapply in
|
||||||
favor of using `apply`. Please be sure to upgrade
|
favor of using `apply`. Please be sure to upgrade
|
||||||
all code to work with `apply`.
|
all code to work with `apply`.
|
||||||
|
|
||||||
(apply function-call args kwargs) ; is the signature
|
(apply function-call args kwargs) ; is the signature
|
||||||
|
|
||||||
[Thanks]
|
[Thanks]
|
||||||
@ -204,17 +206,17 @@ Changes from 0.9.12
|
|||||||
As always, massive hugs to olasd for the constant reviews and for
|
As always, massive hugs to olasd for the constant reviews and for
|
||||||
implementing HyCons cells. Thanks to @kenanb for redesigning the
|
implementing HyCons cells. Thanks to @kenanb for redesigning the
|
||||||
new Hy logo.
|
new Hy logo.
|
||||||
|
|
||||||
Many thanks to algernon for working on adderall, which helped
|
Many thanks to algernon for working on adderall, which helped
|
||||||
push Hy further this cycle. Adderall is an implementation of miniKanren
|
push Hy further this cycle. Adderall is an implementation of miniKanren
|
||||||
in Hy. If you're interested in using Adderall, check out hydiomatic,
|
in Hy. If you're interested in using Adderall, check out hydiomatic,
|
||||||
which prettifies Hy source using Adderall rules.
|
which prettifies Hy source using Adderall rules.
|
||||||
|
|
||||||
This release saw an increase of about 11 contributors for a point
|
This release saw an increase of about 11 contributors for a point
|
||||||
release, you guys rock!
|
release, you guys rock!
|
||||||
|
|
||||||
-Hy Society
|
-Hy Society
|
||||||
|
|
||||||
[ Language Changes ]
|
[ Language Changes ]
|
||||||
|
|
||||||
* `for' revamped again (Last time, we hope!), this time using a saner
|
* `for' revamped again (Last time, we hope!), this time using a saner
|
||||||
@ -232,7 +234,7 @@ Changes from 0.9.12
|
|||||||
* `disassemble' added to core, which dumps the AST or equivalent python code
|
* `disassemble' added to core, which dumps the AST or equivalent python code
|
||||||
* `coll?' added to core to check for a collection
|
* `coll?' added to core to check for a collection
|
||||||
* `identity' function added to core
|
* `identity' function added to core
|
||||||
|
|
||||||
[ Misc. Fixes ]
|
[ Misc. Fixes ]
|
||||||
* Lots of doc fixes. Reorganization as well as better docs on Hy internals
|
* Lots of doc fixes. Reorganization as well as better docs on Hy internals
|
||||||
* Universal Wheel Support
|
* Universal Wheel Support
|
||||||
@ -240,11 +242,11 @@ Changes from 0.9.12
|
|||||||
from clojure to hy
|
from clojure to hy
|
||||||
* Hy REPL supports invoking with --spy & -i options [reword]
|
* Hy REPL supports invoking with --spy & -i options [reword]
|
||||||
* `first' and `rest' are functions and not macros anymore
|
* `first' and `rest' are functions and not macros anymore
|
||||||
* "clean" target added to Makefile
|
* "clean" target added to Makefile
|
||||||
* hy2py supports a bunch of commandline options to show AST, source etc.
|
* hy2py supports a bunch of commandline options to show AST, source etc.
|
||||||
* Sub-object mangling: every identifier is split along the dots & mangled
|
* Sub-object mangling: every identifier is split along the dots & mangled
|
||||||
separately
|
separately
|
||||||
|
|
||||||
[ Bug Fixes ]
|
[ Bug Fixes ]
|
||||||
* Empty MacroExpansions work as expected
|
* Empty MacroExpansions work as expected
|
||||||
* Python 3.4 port. Sorry this wasn't in a 3.4 release time, we forgot to do
|
* Python 3.4 port. Sorry this wasn't in a 3.4 release time, we forgot to do
|
||||||
@ -268,18 +270,18 @@ Changes from Hy 0.9.11
|
|||||||
0.9.12 comes with some massive changes,
|
0.9.12 comes with some massive changes,
|
||||||
We finally took the time to implement gensym, as well as a few
|
We finally took the time to implement gensym, as well as a few
|
||||||
other bits that help macro writing. Check the changelog for
|
other bits that help macro writing. Check the changelog for
|
||||||
what exactly was added.
|
what exactly was added.
|
||||||
|
|
||||||
The biggest feature, Reader Macros, landed later
|
The biggest feature, Reader Macros, landed later
|
||||||
in the cycle, but were big enough to warrant a release on its
|
in the cycle, but were big enough to warrant a release on its
|
||||||
own. A huge thanks goes to Foxboron for implementing them
|
own. A huge thanks goes to Foxboron for implementing them
|
||||||
and a massive hug goes out to olasd for providing ongoing
|
and a massive hug goes out to olasd for providing ongoing
|
||||||
reviews during the development.
|
reviews during the development.
|
||||||
|
|
||||||
Welcome to the new Hy contributors, Henrique Carvalho Alves,
|
Welcome to the new Hy contributors, Henrique Carvalho Alves,
|
||||||
Kevin Zita and Kenan Bölükbaşı. Thanks for your work so far,
|
Kevin Zita and Kenan Bölükbaşı. Thanks for your work so far,
|
||||||
folks!
|
folks!
|
||||||
|
|
||||||
Hope y'all enjoy the finest that 2013 has to offer,
|
Hope y'all enjoy the finest that 2013 has to offer,
|
||||||
- Hy Society
|
- Hy Society
|
||||||
|
|
||||||
@ -390,7 +392,7 @@ Changes from Hy 0.9.10
|
|||||||
Changes from Hy 0.9.9
|
Changes from Hy 0.9.9
|
||||||
|
|
||||||
[ Stupid Fixes ]
|
[ Stupid Fixes ]
|
||||||
|
|
||||||
* I forgot to include hy.core.language in the sdist. (PT)
|
* I forgot to include hy.core.language in the sdist. (PT)
|
||||||
|
|
||||||
Changes from Hy 0.9.8
|
Changes from Hy 0.9.8
|
||||||
|
@ -1485,6 +1485,7 @@ class HyASTCompiler(object):
|
|||||||
optional_vars=thing)]
|
optional_vars=thing)]
|
||||||
|
|
||||||
ret = ctx + the_with
|
ret = ctx + the_with
|
||||||
|
ret.contains_yield = ret.contains_yield or body.contains_yield
|
||||||
# And make our expression context our temp variable
|
# And make our expression context our temp variable
|
||||||
expr_name = ast.Name(id=ast_str(var), arg=ast_str(var),
|
expr_name = ast.Name(id=ast_str(var), arg=ast_str(var),
|
||||||
ctx=ast.Load(),
|
ctx=ast.Load(),
|
||||||
|
@ -727,6 +727,14 @@
|
|||||||
(with [(open "README.md" "r")] (do)))
|
(with [(open "README.md" "r")] (do)))
|
||||||
|
|
||||||
|
|
||||||
|
(defn test-context-yield []
|
||||||
|
"NATIVE: test yields inside of with statements don't try to return before Python 3.3"
|
||||||
|
(defn f []
|
||||||
|
(with [(open "README.md")] (yield 123)))
|
||||||
|
|
||||||
|
(assert (= (next (f)) 123)))
|
||||||
|
|
||||||
|
|
||||||
(defn test-with-return []
|
(defn test-with-return []
|
||||||
"NATIVE: test that with returns stuff"
|
"NATIVE: test that with returns stuff"
|
||||||
(defn read-file [filename]
|
(defn read-file [filename]
|
||||||
@ -896,7 +904,7 @@
|
|||||||
|
|
||||||
(defn test-and []
|
(defn test-and []
|
||||||
"NATIVE: test the and function"
|
"NATIVE: test the and function"
|
||||||
|
|
||||||
(setv and123 (and 1 2 3)
|
(setv and123 (and 1 2 3)
|
||||||
and-false (and 1 False 3)
|
and-false (and 1 False 3)
|
||||||
and-true (and)
|
and-true (and)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user