Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
30e51837
Commit
30e51837
authored
Jun 06, 2015
by
NicolasPetton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* lisp/emacs-lisp/map.el (map-let): Better docstring.
parent
2a54e8df
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
lisp/emacs-lisp/map.el
lisp/emacs-lisp/map.el
+13
-8
No files found.
lisp/emacs-lisp/map.el
View file @
30e51837
...
...
@@ -47,20 +47,25 @@
(
pcase-defmacro
map
(
&rest
args
)
"pcase pattern matching map elements.
Matches if the object is a map (list, hash-table or array), and
binds values from ARGS to the corresponding element of the map.
binds values from ARGS to the
ir
corresponding element
s
of the map.
ARGS can be a list elements of the form (KEY
.
PAT) or elements
of the form SYMBOL, which stands for (SYMBOL
.
SYMBOL)."
ARGS can be a list elements of the form (KEY PAT) or elements
of the form SYMBOL, which stands for (
'
SYMBOL SYMBOL)."
`
(
and
(
pred
map-p
)
,@
(
map--make-pcase-bindings
args
)))
(
defmacro
map-let
(
arg
s
map
&rest
body
)
"Bind the variables in
ARG
S to the elements of MAP then evaluate BODY.
(
defmacro
map-let
(
key
s
map
&rest
body
)
"Bind the variables in
KEY
S to the elements of MAP then evaluate BODY.
ARGS can be an alist of key/binding pairs or a list of keys. MAP
can be a list, hash-table or array."
KEYS can be a list of symbols, in which case each element will be
bound to the looked up value in MAP.
KEYS can also be a list of (KEY VARNAME) pairs, in which case
KEY is not quoted.
MAP can be a list, hash-table or array."
(
declare
(
indent
2
)
(
debug
t
))
`
(
pcase-let
((
,
(
map--make-pcase-patterns
arg
s
)
,
map
))
`
(
pcase-let
((
,
(
map--make-pcase-patterns
key
s
)
,
map
))
,@
body
))
(
defmacro
map--dispatch
(
spec
&rest
args
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment