[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ELPA-diffs] /srv/bzr/emacs/elpa r303: Add cl-letf and cl-labels.
From: |
Stefan Monnier |
Subject: |
[ELPA-diffs] /srv/bzr/emacs/elpa r303: Add cl-letf and cl-labels. |
Date: |
Thu, 22 Nov 2012 16:51:43 -0500 |
User-agent: |
Bazaar (2.5.0) |
------------------------------------------------------------
revno: 303
committer: Stefan Monnier <address@hidden>
branch nick: elpa
timestamp: Thu 2012-11-22 16:51:43 -0500
message:
Add cl-letf and cl-labels.
modified:
packages/cl-lib/cl-lib.el
=== modified file 'packages/cl-lib/cl-lib.el'
--- a/packages/cl-lib/cl-lib.el 2012-11-16 15:56:07 +0000
+++ b/packages/cl-lib/cl-lib.el 2012-11-22 21:51:43 +0000
@@ -4,7 +4,7 @@
;; Author: Stefan Monnier <address@hidden>
;; vcomment: Emacs-24.3's version is 1.0 so this has to stay below.
-;; Version: 0.1
+;; Version: 0.2
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -173,7 +173,7 @@
callf2
callf
letf*
- ;; letf
+ letf
rotatef
shiftf
remf
@@ -276,5 +276,14 @@
(intern (format "cl-%s" fun)))))
(defalias new fun)))
+;; `cl-labels' is not 100% compatible with `labels' when using dynamic scoping
+;; (mostly because it does not turn lambdas that refer to those functions into
+;; closures). OTOH it is compatible when using lexical scoping.
+
+(defmacro cl-labels (&rest args)
+ (if (and (boundp 'lexical-binding) lexical-binding)
+ `(labels ,@args)
+ (error "`cl-labels' with dynamic scoping is not implemented")))
+
(provide 'cl-lib)
;;; cl-lib.el ends here
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [ELPA-diffs] /srv/bzr/emacs/elpa r303: Add cl-letf and cl-labels.,
Stefan Monnier <=