Skip to content

Tags: sailfish009/unpythonic

Tags

v0.14.2.1

Toggle v0.14.2.1's commit message
Update version number

v0.14.2

Toggle v0.14.2's commit message
Oops.

v0.14.1

Toggle v0.14.1's commit message
Version 0.14.1 "Retrofuturistic edition"

**Language version**:

- Support Python 3.6. First released in 2016, supported until 2021, most distros should have it by now.
- This will be the final release that supports Python 3.4; upstream support for 3.4 ended in March 2019.

**New**:

- ``Popper``, a pop-while iterator.
- ``window``, a length-n sliding window iterator for general iterables.
- ``autoref[]`` can now be nested.
- ``dbg[]`` now supports also an expression variant, customizable by lexically assigning ``dbgprint_expr``. See the README on macros for details.

**Bugfixes**:

- Fix crash when SymPy or mpmath are not installed.
- ``mogrify`` is now part of the public API, as it should have been all along.
- Docs: Mention the ``mg`` function in the README.

**Non-breaking changes**:

- Future-proof ``namelambda`` for Python 3.8.
- Docs: ``dbg[]`` is now listed as a convenience feature in the README.

v0.14.0

Toggle v0.14.0's commit message
**Bugfixes**:

 - ``setup.py``: macros are not zip safe, because ``ZipImporter`` fails to return source code for the module and MacroPy needs that.
 - fix splicing in the ``do[]`` macro; ``ExpandedDoView`` should now work correctly
 - fix lambda handling in the ``lazify`` macro
 - fix ``dict_items`` handling in ``mogrify`` (fixes the use of the ``curry`` macro with code using ``frozendict``)

**New**:

 - ``roview``: a read-only view into a sequence. Behaves mostly the same as ``view``, but has no ``__setitem__`` or ``reverse``.
 - ``mg``: a decorator to mathify a gfunc, so that it will ``m()`` the generator instances it makes.
 - The ``do[]`` macro now supports ``delete[name]`` to delete a local variable previously created in the same do-expression using ``local[name << value]``.
 - ``envify`` block macro, to make formal parameters live in an unpythonic ``env``.
 - ``autoref`` block macro, to implicitly reference attributes of an object (for reading only).

**Breaking changes**:

 - The ``macropy3`` bootstrapper now takes the ``-m`` option; ``macropy3 -m somemod``, like ``python3 -m somemod``. The alternative is to specify a filename positionally; ``macropy3 somescript.py``, like ``python3 somescript.py``. In either case, the bootstrapper will import the module in a special mode that pretends its ``__name__ == '__main__'``, to allow using the pythonic conditional main idiom also in macro-enabled code.
 - The constructor of the writable ``view`` now checks that the input is not read-only (``roview``, or a ``Sequence`` that is not also a ``MutableSequence``) before allowing creation of the writable view.
 - ``env`` now checks finalization status also when deleting attrs (a finalized ``env`` cannot add or delete bindings)

**Non-breaking improvements**:

 - ``env`` now provides also the ``collections.abc.MutableMapping`` API.
 - The ``tco`` macro now skips nested ``continuations`` blocks (to allow [Lispython](https://github.com/Technologicat/pydialect/tree/master/lispython) in [Pydialect](https://github.com/Technologicat/pydialect) to support ``continuations``).
 - ``setup.py`` now installs the ``macropy3`` bootstrapper.

v0.13.1

Toggle v0.13.1's commit message
Many small improvements, particularly regards to slicing.

v0.13.0

Toggle v0.13.0's commit message
Add lazify and mathseq; many other small changes and improvements.

v0.12.0

Toggle v0.12.0's commit message
New:

 - Alternative, haskelly ``let`` syntax ``let[((x, 2), (y, 3)) in x + y]`` and ``let[x + y, where((x, 2), (y, 3))]``
   - Supported by all ``let`` forms: ``let``, ``letseq``, ``letrec``, ``let_syntax``, ``abbrev``
 - When making just one binding, can now omit outer parentheses in ``let``: ``let(x, 1)[...]``, ``let[(x, 1) in ...]``, ``let[..., where(x, 1)]``
 - ``unpythonic.misc.Box``: the classic rackety single-item mutable container
 - Many small improvements to documentation

Breaking changes:

 - New, perhaps more natural ``call_cc[]`` syntax for continuations, replaces earlier ``with bind[...]``
   - Conditional continuation capture with ``call_cc[f() if p else None]``
   - ``cc`` parameter now added implicitly, no need to declare explicitly unless actually needed (reduces visual noise in client code)
 - Local variables in a ``do`` are now declared using macro-expr syntax ``local[x << 42]``, looks more macropythonic
 - Silly ``(lambda)`` suffix removed from names of named lambdas (to detect them in client code, it's enough that ``isinstance(f, types.LambdaType)``)

v0.11.1

Toggle v0.11.1's commit message
- enh: create a proper decorator registry for the syntax machinery

  - can now register priorities for custom decorators to tell the syntax system about their correct ordering (for sort_lambda_decorators, suggest_decorator_index)
  - register priorities for (some of) unpythonic's own decorators using this new system, replacing the old hardcoded decorator registry
  - now lives in ``unpythonic.regutil``; used only by the syntax subsystem, but doesn't require MacroPy just to start up
- enh: try to determine correct insertion index for ``trampolined`` and ``curry`` decorators in macros that insert them (using any already applied known decorators as placement hints)
- enh: namedlambda: recognize also decorated lambdas, and calls to ``curry`` where the last argument is a lambda (useful for ``looped_over`` et al.)
- breaking change: remove special jump target ``SELF`` (hack, no longer needed now that we have the ``withself`` function to allow a lambda to refer to itself)

v0.11.0

Toggle v0.11.0's commit message
New:

- Add @callwith: freeze arguments, choose function later
- Add withself: allow a lambda to refer to itself
- Add let_syntax: splice code at macro expansion time
- Add quicklambda: block macro to combo our blocks with MacroPy's quick_lambda
- Add debug option to MacroPy bootstrapper

Enhancements:

- prefix macro now works together with let and do

Bugfixes:

- detect TCO'd lambdas correctly (no longer confused by intervening FunctionDef nodes with TCO decorators)
- scoping: detect also names bound by For, Import, Try, With

Breaking changes:

- Rename dynscope --> dynassign; technically dynamic assignment, not scoping
- Rename localdef --> local; shorter, more descriptive
- scanr now returns results in the order computed (**CAUTION**: different from Haskell)
- simple_let, simple_letseq --> let, letseq in unpythonic.syntax.simplelet
- cons now prints pythonically by default, to allow eval; use .lispyrepr() to get the old output
- Remove separate dynvar curry_toplevel_passthrough; expose curry_context instead

Other:

- Reorganize source tree, tests now live inside the project
- Pythonize runtests, no more bash script
- Add countlines Python script to estimate project size

v0.10.4

Toggle v0.10.4's commit message
- new: macro wrappers for the let decorators

- fix: trampolined() should go on the outside even if the client code manually uses curry()
- enh: improve tco, fploop combo
- enh: improve lexical scoping support