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

Improve destructuring #182

Merged
merged 1 commit into from
Feb 19, 2024
Merged

Improve destructuring #182

merged 1 commit into from
Feb 19, 2024

Commits on Feb 19, 2024

  1. Improve destructuring and re-implement in pcase.

    # Basic Changes
    
    - Update README and CHANGELOG.
    - Add destructuring features
    - Re-implement destructuring using `pcase`.
    
    # More Details
    
    ## All Constructs
    
    - Re-implement destructuring of normal values using `pcase`, reducing the
      maintenance burden and making further improvements easier.
      - Make it so that the existing destructuring features will signal
        an error if the `pcase` pattern doesn't match, instead of failing silently
        as in `pcase`.
    - Support full forms being vectors as well as lists.
    
    ## `&key`
    
    - Improve `&key`:
      - Make `&key` signal an error when there are unmatched keys in the property
        list.
      - Add `&allow-other-keys`.
      - Support the full form `((KEY VAR) DEFAULT SUPPLIED)`.
    
    ## `&map`
    
    - Add `&map` as `(KEY VAR DEFAULT SUPPLIED)`.
    
    - Add `&optional` form `(VAR DEFAULT SUPPLIED)`.
    - Rename `loopy--parse-destructuring-accumulation-command`
      to `loopy--parse-destructuring-accumulation-command-default`
    - Remove alias `loopy--destructure-generalized-variables`
      from `loopy--destructure-generalized-sequence`
    
    ## New Files
    
    - Move some destructuring features from `loopy-misc.el` to
      `loopy-destructure.el`.
    - Move some instruction features from `loopy-misc.el` to
      `loopy-instr.el`
    
    ## Test Changes
    
    - Add many tests.
    - Update the `Makefile`.
    - Only test the most recent minor version of each major version.
    
    ## Removed Features
    
    - Remove the following functions:
      - `loopy--every-other`
      - `loopy--split-list-before`
      - `loopy--split-off-last-var`
      - `loopy--destructure-sequence`
      - `loopy--destructure-list`
      - `loopy--destructure-array`
      - `loopy--generate-inc-idx-instructions`
    
    ## Added Features
    
    - Add the following functions:
      - `loopy-seq--make-pcase-pattern`
      - `loopy--get-var-groups`
      - `loopy--get-&key-spec`
      - `loopy--get-&map-spec`
      - `loopy--get-&aux-spec`
      - `loopy--get-var-pattern`
      - `loopy--pcase-pat-positional-list-pattern`
      - `loopy--pcase-pat-positional-array-pattern`
      - `loopy--pcase-pat-&key-pattern`
      - `loopy--pcase-pat-&map-pattern`
      - `loopy--pcase-pat-&aux-pattern`
      - `loopy--pcase-destructure-for-iteration`
      - `loopy--pcase-destructure-for-with-vars`
      - `loopy--pcase-parse-for-destructuring-accumulation-command`
    okamsn committed Feb 19, 2024
    Configuration menu
    Copy the full SHA
    3c58a51 View commit details
    Browse the repository at this point in the history