Skip to content

Commit d063bf9

Browse files
committed
document v0.15.0 changes
1 parent 34a8743 commit d063bf9

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

doc/features.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ For many examples, see [the unit tests](unpythonic/tests/), the docstrings of th
8181

8282
*This document doubles as the API reference, but despite maintenance on a best-effort basis, may occasionally be out-of-date at places. In case of conflicts in documentation, believe the unit tests first; specifically the code, not necessarily the comments. Everything else (comments, docstrings and this guide) should agree with the unit tests. So if something fails to work as advertised, check what the tests say - and optionally file an issue on GitHub so that the documentation can be fixed.*
8383

84-
**This document is up-to-date for v0.14.3.**
84+
**This document is up-to-date for v0.15.0.**
8585

8686
## Bindings
8787

doc/macros.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Because in Python macro expansion occurs *at import time*, Python programs whose
4444
- [``envify``: make formal parameters live in an unpythonic ``env``](#envify-make-formal-parameters-live-in-an-unpythonic-env)
4545

4646
[**Language features**](#language-features)
47-
- [``curry``: automatic currying for Python](#curry-automatic-currying-for-python)
47+
- [``autocurry``: automatic currying for Python](#autocurry-automatic-currying-for-python)
4848
- [``lazify``: call-by-need for Python](#lazify-call-by-need-for-python)
4949
- [``lazy[]`` and ``lazyrec[]`` macros](#lazy-and-lazyrec-macros)
5050
- [Forcing promises manually](#forcing-promises-manually)
@@ -805,7 +805,9 @@ The ``with`` block adds a few elements, but if desired, it can be refactored int
805805

806806
To boldly go where Python without macros just won't. Changing the rules by code-walking and making significant rewrites.
807807

808-
### ``curry``: automatic currying for Python
808+
### ``autocurry``: automatic currying for Python
809+
810+
**Changed in v0.15.0.** *The macro is now named `autocurry`, to avoid shadowing the `curry` function.*
809811

810812
```python
811813
from unpythonic.syntax import macros, autocurry
@@ -903,6 +905,8 @@ Inspired by Haskell, Racket's ``(delay)`` and ``(force)``, and [lazy/racket](htt
903905

904906
#### ``lazy[]`` and ``lazyrec[]`` macros
905907

908+
**Changed in v0.15.0.** *Previously, the `lazy[]` macro was provided by MacroPy. Now that we use `mcpyrate`, which doesn't provide it, we provide it ourselves, in `unpythonic.syntax`. Note that a lazy value now no longer has a `__call__` operator; instead, it has a `force()` method. The utility `unpythonic.lazyutil.force` (available in the top-level namespace of `unpythonic`) abstracts away this detail.*
909+
906910
We provide the macros ``unpythonic.syntax.lazy``, which explicitly lazifies a single expression, and ``unpythonic.syntax.lazyrec``, which can be used to lazify expressions inside container literals, recursively.
907911

908912
Essentially, ``lazy[...]`` achieves the same result as ``memoize(lambda: ...)``, with the practical difference that a ``lazy[]`` promise ``p`` is evaluated by calling ``unpythonic.lazyutil.force(p)`` or ``p.force()``. In ``unpythonic``, the promise datatype (``unpythonic.lazyutil.Lazy``) does not have a ``__call__`` method, because the word ``force`` better conveys the intent.
@@ -919,6 +923,8 @@ The `unpythonic` containers **must be from-imported** for ``lazyrec[]`` to recog
919923

920924
#### Forcing promises manually
921925

926+
**Changed in v0.15.0.** *The functions `force1` and `force` now live in the top-level namespace of `unpythonic`, no longer in `unpythonic.syntax`.*
927+
922928
This is mainly useful if you ``lazy[]`` or ``lazyrec[]`` something explicitly, and want to compute its value outside a ``with lazify`` block.
923929

924930
We provide the functions ``force1`` and ``force``. Using ``force1``, if ``x`` is a ``lazy[]`` promise, it will be forced, and the resulting value is returned. If ``x`` is not a promise, ``x`` itself is returned, à la Racket. The function ``force``, in addition, descends into containers (recursively). When an atom ``x`` (i.e. anything that is not a container) is encountered, it is processed using ``force1``.

0 commit comments

Comments
 (0)