-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve destructuring and re-implement in
pcase
. (#182)
# 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)`. ## `&optional` - Add `&optional` form `(VAR DEFAULT SUPPLIED)`. ## 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 for the `pcase` pattern. - Update tests in ways that make sense for the new implementation. - Update the `Makefile`. - Only test the most recent minor version of each major version in the GitHub Actions. ## Removed Features - Remove alias: - `loopy--destructure-generalized-variables` for `loopy--destructure-generalized-sequence` - `loopy--basic-builtin-destructuring` for `loopy--destructure-for-iteration-command` - 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` ## Renamed Features - Rename `loopy--parse-destructuring-accumulation-command` to `loopy--parse-destructuring-accumulation-command-default`
- Loading branch information
Showing
23 changed files
with
3,436 additions
and
1,713 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,16 @@ | ||
EMACS ?= emacs | ||
|
||
.PHONY: tests | ||
|
||
tests: | ||
emacs -Q -batch -l ert -l tests/load-path.el -l tests/tests.el -f ert-run-tests-batch-and-exit | ||
$(EMACS) -Q -batch -l ert -l tests/load-path.el -l tests/tests.el -f ert-run-tests-batch-and-exit | ||
|
||
.PHONY: iter-tests | ||
|
||
iter-tests: | ||
emacs -Q -batch -l ert -l tests/load-path.el -l tests/iter-tests.el -f ert-run-tests-batch-and-exit | ||
$(EMACS) -Q -batch -l ert -l tests/load-path.el -l tests/iter-tests.el -f ert-run-tests-batch-and-exit | ||
|
||
.PHONY: misc-tests | ||
|
||
misc-tests: | ||
$(EMACS) -Q -batch -l ert -l tests/load-path.el -l tests/misc-tests.el -f ert-run-tests-batch-and-exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.