diff options
author | Mark Oteiza <mvoteiza@udel.edu> | 2017-09-12 12:44:45 -0400 |
---|---|---|
committer | Mark Oteiza <mvoteiza@udel.edu> | 2017-09-12 13:18:06 -0400 |
commit | 4612b2a2b37026bef5a9b8e92878a15dabb9b261 (patch) | |
tree | 2434bb2f510047ae9570086c424266743411a39f /etc | |
parent | c87331a1c04aa4be55be7b944680e4ec486f5b04 (diff) | |
download | emacs-4612b2a2b37026bef5a9b8e92878a15dabb9b261.tar.gz |
Implement and-let*
This also includes changes to if-let and when-let. The single tuple
special case is ambiguous, and binding a symbol to nil is not as
useful as binding it to its value outside the lexical scope of the
binding. (Bug#28254)
* etc/NEWS: Mention.
* lisp/emacs-lisp/subr-x.el (internal--listify):
(internal--build-binding-value-form): Extend to account for
solitary symbols and (EXPR) items in binding varlist.
(if-let*, when-let*): Nix single tuple case and incumbent
bind-symbol-to-nil behavior.
(and-let*): New macro.
(if-let, when-let): Mark obsolete. Redefine in terms of if-let*, so
they implicitly gain the new features without breaking existing code.
* test/lisp/emacs-lisp/subr-x-tests.el: Adjust tests for: lack of
single-tuple special case, lack of binding solitary symbols to nil,
and the introduction of uninterned symbols for (EXPR) bindings. Add
SRFI-2 test suite adapted to Elisp.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/NEWS | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -1137,6 +1137,14 @@ be disabled by setting 'byte-compile-cond-use-jump-table' to nil. ** The alist 'ucs-names' is now a hash table. --- +** 'if-let' and 'when-let' are subsumed by 'if-let*' and 'when-let*'. +The incumbent 'if-let' and 'when-let' are now marked obsolete. +'if-let*' and 'when-let*' do not accept the single tuple special case. +New macro 'and-let*' is an implementation of the Scheme SRFI-2 syntax +of the same name. 'if-let*' and 'when-let*' now accept the same +binding syntax as 'and-let*'. + +--- ** 'C-up', 'C-down', 'C-left' and 'C-right' are now defined in term mode to send the same escape sequences that xterm does. This makes things like forward-word in readline work. @@ -1529,10 +1537,6 @@ It avoids unnecessary consing (and garbage collection). ** 'gensym' is now part of Elisp. --- -** 'if-let*', 'when-let*', and 'and-let*' are new in subr-x.el. -The incumbent 'if-let' and 'when-let' are now aliases. - ---- ** Low-level list functions like 'length' and 'member' now do a better job of signaling list cycles instead of looping indefinitely. |