Skip to content
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

unquote/unpacking improvements #1545

Closed
wants to merge 3 commits into from

Commits on Mar 25, 2018

  1. Improve replace on HyObject so it does less work

    Calling `replace` can trigger a call to `replace_hy_obj`, which will
    try to also wrap values inside a `HyObject`.
    
    However, this means when we try to recusively replace inside a nested
    object, like a `HyList`, we should try and capture these new wrapped
    objects.
    
    Hy still works if we don't, but it results in the object getting
    rewrapped multiple times during a compile.
    
    Closes hylang#1519
    vodik committed Mar 25, 2018
    Configuration menu
    Copy the full SHA
    70a414c View commit details
    Browse the repository at this point in the history
  2. Attempt to wrap iterables

    Instead of crashing when trying to unwrap an iterable, first expand it
    and then try to wrap the resulting list.
    
    This allows `unquote` to work with iterators and generators, which
    previously didn't work unless you used `unquote-splice` or explicitly
    expanded a list first.
    vodik committed Mar 25, 2018
    Configuration menu
    Copy the full SHA
    8dfbfd5 View commit details
    Browse the repository at this point in the history
  3. Use PEP 448 for better unquoted expressions

    With Python 3.5, we can have an arbitrary number of unpackings. We can
    use this to emit cleaner expressions.
    
    Falls back to legacy behaviour for older Python versions.
    vodik committed Mar 25, 2018
    Configuration menu
    Copy the full SHA
    f197363 View commit details
    Browse the repository at this point in the history