8000 Release v1.4.1 [Ernest Scribbler] by evhub · Pull Request #512 · evhub/coconut · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Release v1.4.1 [Ernest Scribbler] #512

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 169 commits into from
Aug 8, 2019
Merged

Release v1.4.1 [Ernest Scribbler] #512

merged 169 commits into from
Aug 8, 2019

Conversation

evhub
Copy link
Owner
@evhub evhub commented Jul 27, 2019

See Coconut's documentation for more information on all of the features listed below.

New features:

Plus lots and lots of bugfixes!

evhub and others added 30 commits August 15, 2018 17:43
Signed-off-by: eindiran <eindiran@uchicago.edu>
Signed-off-by: eindiran <eindiran@uchicago.edu>
Signed-off-by: eindiran <eindiran@uchicago.edu>
Signed-off-by: eindiran <eindiran@promptu.com>
# This is the 1st commit message:

Reword intro; more on LHS on being evaled

Signed-off-by: eindiran <eindiran@promptu.com>

# This is the commit message #2:

Fix left<->right typo; minor wording improvements

Signed-off-by: eindiran <eindiran@promptu.com>
The added implementation XORs the `tuple.__hash__` of the data object
with the hash of the class.  This should help to avoid collisions
between instances of different data types with identical members.

Also added a test which ensures that:
* hash of a data type instance can be computed;
* hashes of instances of different data types with same data differ;
* hash of a data type instance differs from hash of a plain tuple.

Fixes #446.
This change covers the cases like:

    def f(x) = return x

or

    def f(x) =
        return x

These previously used to raise CoconutParseErrors, and this was not
obvious what should be done to fix the code.  With this change the errors
are raised with a meaningful error message.

Fixes #354.
The test previously failed because IPyKernel.do_execute had become
a coroutine, which the test did not expect.  Now, if a Future is
returned, it is unwrapped, otherwise (for compatibility with older
versions) the return value is left as-is.

Fixes #457.
This change introduces a context stack with MatchError subclasses
that pattern-matching functions must raise instead of plain MatchError.

This works the following way:

* Every time a function is decorated with @addpattern, a subclass of
MatchError is created and stored in the local scope;
* when such function is called, this subclass is put on the stack
before execution of addpattern's base_func;
* when a pattern-matching function is called, it checks whether
the exception class at the top of the stack has been already taken;
* if it wasn't, the function marks it as taken (so that no other
function would take it from the stack) and will raise it instead of
plain MatchError;
* inside addpattern, this specific exception is caught instead of
MatchError.

As a result, any pattern-matching function called directly as
addpattern's base_func will raise a specific subclass of MatchError
but will not propagate it to any pattern-matching functions called inside.

The only case when addpattern will still catch a MatchError incorrectly
is when addpattern wraps a non-pattern-matching function which calls a
pattern-matching function internally (because the non-pattern-matching
function will not mark the exception on the context stack as taken),
but this should be extremely rare because addpattern is meant only for
pattern-matching functions.

This is an alternative implementation of PR #435.
@evhub evhub added the release label Jul 27, 2019
@evhub evhub added this to the v1.4.1 milestone Jul 27, 2019
@evhub evhub added the resolved label Aug 8, 2019
@evhub evhub merged commit 850f78c into master Aug 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
0