summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/map.el
Commit message (Collapse)AuthorAgeFilesLines
...
* Add support for gv.el in map.elNicolas Petton2015-07-091-66/+60
| | | | | | | * lisp/emacs-lisp/map.el (map-elt, map-delete): Declare a gv-expander. * lisp/emacs-lisp/map.el (map-put): Refactor using `setf' and `map-elt'. * test/automated/map-tests.el: Update tests to work with the new implementations of map-elt and map-put.
* Revert "Define `map-elt' as a generalized variable"Nicolas Petton2015-06-211-28/+24
| | | | This reverts commit 8b6d82d3ca86f76ed964063b3941a7c6ab0bf1c6.
* Define `map-elt' as a generalized variableNicolas Petton2015-06-211-24/+28
| | | | | | | | | | | * lisp/emacs-lisp/map.el (map-elt): Define a gv-expander. * lisp/emacs-lisp/map.el (map--dispatch): Tighten the code. * lisp/emacs-lisp/map.el (map-put): Redefine it as a function using a `setf' with `map-elt'. * test/automated/map-tests.el: Comment out `test-map-put-literal'.
* Reuse `alist-get' in map.elNicolas Petton2015-06-211-10/+2
| | | | | * lisp/emacs-lisp/map.el (map-elt): Use `alist-get' to retrieve alist elements.
* * lisp/emacs-lisp/map.el (map-into): Fix a byte-compiler warning.Nicolas Petton2015-06-161-2/+2
|
* * lisp/emacs-lisp/map.el (map-let): Better docstring.Nicolas Petton2015-06-151-3/+6
|
* * lisp/emacs-lisp/map.el (map-let): Better docstring.Nicolas Petton2015-06-061-8/+13
|
* Better syntax for the map pcase patternNicolas Petton2015-06-061-1/+1
| | | | | * lisp/emacs-lisp/map.el: Improves the map pcase pattern to take bindings of the form (KEY PAT) or SYMBOL. KEY is not quoted.
* * lisp/emacs-lisp/map.el (map--dispatch): Better docstring.Nicolas Petton2015-06-061-2/+2
|
* ; * lisp/emacs-lisp/map.el: Fix formatting.Nicolas Petton2015-06-061-7/+7
|
* Fix a byte-compiler error in map-put and map-deleteNicolas Petton2015-06-061-10/+16
| | | | | * lisp/emacs-lisp/map.el (map-put, map-delete): Ensure that `setq' is called with a symbol.
* * lisp/emacs-lisp/map.el (map--dispatch): Move before use.Glenn Morris2015-06-051-32/+32
| | | | (map--delete-array): Fix typo.
* * lisp/emacs-lisp/map.el: Better docstring for the map pcase macro.Nicolas Petton2015-06-041-1/+2
|
* Add a pcase pattern for maps and `map-let' based on itNicolas Petton2015-06-021-0/+35
| | | | | | * lisp/emacs-lisp/map.el (map-let): New macro. (map--make-pcase-bindings, map--make-pcase-patterns): New functions. * test/automated/map-tests.el: New test for `map-let'.
* Improve the docstring of functions in map.elNicolas Petton2015-05-161-19/+58
| | | | | | | | Since a map is not a data structure but a concept, adding information about the possible types of maps can be useful information. * lisp/emacs-lisp/map.el: Add documentation about the type of MAP to each public function.
* Faster implementation of map-empty-pNicolas Petton2015-04-291-1/+5
| | | | | * lisp/emacs-lisp/map.el (map-empty-p): Faster implementation using specific tests depending on the type of the map.
* * lisp/emacs-lisp/map.el: Better docstrings.Nicolas Petton2015-04-291-9/+6
|
* * lisp/emacs-lisp/map.el (map-pairs): Dump redundant lambdaArtur Malabarba2015-04-251-3/+1
|
* * lisp/emacs-lisp/map.el (map--elt-list): Better docstring.Nicolas Petton2015-04-251-1/+1
|
* * lisp/emacs-lisp/map.el (map--elt-list): Minor refactoring.Nicolas Petton2015-04-251-1/+1
|
* Fix a false negative in `map-elt' with alists and values being nilNicolas Petton2015-04-251-2/+11
| | | | | | | | * lisp/emacs-lisp/map.el (map-elt): If map is an alist and key is found but its associated value is nil, do not return the default value. * test/automated/map-tests.el: Add a regression test.
* * lisp/emacs-lisp/map.el (map--dispatch): Improve the docstring.Nicolas Petton2015-04-241-1/+1
|
* Do not signal an error when trying to delete a key from an arrayNicolas Petton2015-04-241-2/+9
| | | | | | | | * lisp/emacs-lisp/map.el (map-delete): When map is an array, check if the key is present to avoid signaling an error. * test/automated/map-tests.el: Add a test for deleting non-existing keys from maps.
* * lisp/emacs-lisp/map.el: Better docstring.Nicolas Petton2015-04-241-1/+2
|
* Minor improvement in map-elt.Nicolas Petton2015-04-241-2/+11
| | | | | | | | | * lisp/emacs-lisp/map.el (map-elt): Do not use `ignore-errors' when doing a lookup in arrays, but check the boundaries of the array instead. * test/automated/map-tests.el: Adds a test for `map-elt' with arrays and a negative integer as key.
* * lisp/emacs-lisp/map.el (map-into): Better error message.Nicolas Petton2015-04-181-1/+1
|
* * lisp/emacs-lisp/map.el: Removes byte-compilation warnings.Nicolas Petton2015-04-181-4/+4
|
* Throw an error when converting a map into an unknown map typeNicolas Petton2015-04-181-1/+2
| | | | | * lisp/emacs-lisp/map.el (map-into): Throw an error if type is not valid. * test/automated/map-test.el: Add a regression test.
* New library map.el similar to seq.el but for mapping data structures.Nicolas Petton2015-04-181-0/+270
* test/automated/map-test.el: New file. * lisp/emacs-lisp/map.el: New file.