emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/emacs-lisp/cl-macs.el


From: Juanma Barranquero
Subject: [Emacs-diffs] Changes to emacs/lisp/emacs-lisp/cl-macs.el
Date: Sun, 22 May 2005 13:48:55 -0400

Index: emacs/lisp/emacs-lisp/cl-macs.el
diff -c emacs/lisp/emacs-lisp/cl-macs.el:1.50 
emacs/lisp/emacs-lisp/cl-macs.el:1.51
*** emacs/lisp/emacs-lisp/cl-macs.el:1.50       Tue May 17 00:26:59 2005
--- emacs/lisp/emacs-lisp/cl-macs.el    Sun May 22 17:48:54 2005
***************
*** 207,214 ****
  
  (defmacro function* (func)
    "Introduce a function.
! Like normal `function', except that if argument is a lambda form, its
! ARGLIST allows full Common Lisp conventions."
    (if (eq (car-safe func) 'lambda)
        (let* ((res (cl-transform-lambda (cdr func) 'cl-none))
             (form (list 'function (cons 'lambda (cdr res)))))
--- 207,214 ----
  
  (defmacro function* (func)
    "Introduce a function.
! Like normal `function', except that if argument is a lambda form,
! its argument list allows full Common Lisp conventions."
    (if (eq (car-safe func) 'lambda)
        (let* ((res (cl-transform-lambda (cdr func) 'cl-none))
             (form (list 'function (cons 'lambda (cdr res)))))
***************
*** 488,500 ****
  ;;; Conditional control structures.
  
  (defmacro case (expr &rest clauses)
!   "Eval EXPR and choose from CLAUSES on that value.
  Each clause looks like (KEYLIST BODY...).  EXPR is evaluated and compared
  against each key in each KEYLIST; the corresponding BODY is evaluated.
  If no clause succeeds, case returns nil.  A single atom may be used in
  place of a KEYLIST of one atom.  A KEYLIST of t or `otherwise' is
  allowed only in the final clause, and matches if no other keys match.
! Key values are compared by `eql'."
    (let* ((temp (if (cl-simple-expr-p expr 3) expr (make-symbol "--cl-var--")))
         (head-list nil)
         (body (cons
--- 488,501 ----
  ;;; Conditional control structures.
  
  (defmacro case (expr &rest clauses)
!   "Eval EXPR and choose among clauses on that value.
  Each clause looks like (KEYLIST BODY...).  EXPR is evaluated and compared
  against each key in each KEYLIST; the corresponding BODY is evaluated.
  If no clause succeeds, case returns nil.  A single atom may be used in
  place of a KEYLIST of one atom.  A KEYLIST of t or `otherwise' is
  allowed only in the final clause, and matches if no other keys match.
! Key values are compared by `eql'.
! \n(fn EXPR (KEYLIST BODY...)...)"
    (let* ((temp (if (cl-simple-expr-p expr 3) expr (make-symbol "--cl-var--")))
         (head-list nil)
         (body (cons
***************
*** 522,536 ****
  
  (defmacro ecase (expr &rest clauses)
    "Like `case', but error if no case fits.
! `otherwise'-clauses are not allowed."
    (list* 'case expr (append clauses '((ecase-error-flag)))))
  
  (defmacro typecase (expr &rest clauses)
!   "Evals EXPR, chooses from CLAUSES on that value.
  Each clause looks like (TYPE BODY...).  EXPR is evaluated and, if it
  satisfies TYPE, the corresponding BODY is evaluated.  If no clause succeeds,
  typecase returns nil.  A TYPE of t or `otherwise' is allowed only in the
! final clause, and matches if no other keys match."
    (let* ((temp (if (cl-simple-expr-p expr 3) expr (make-symbol "--cl-var--")))
         (type-list nil)
         (body (cons
--- 523,539 ----
  
  (defmacro ecase (expr &rest clauses)
    "Like `case', but error if no case fits.
! `otherwise'-clauses are not allowed.
! \n(fn EXPR (KEYLIST BODY...)...)"
    (list* 'case expr (append clauses '((ecase-error-flag)))))
  
  (defmacro typecase (expr &rest clauses)
!   "Evals EXPR, chooses among clauses on that value.
  Each clause looks like (TYPE BODY...).  EXPR is evaluated and, if it
  satisfies TYPE, the corresponding BODY is evaluated.  If no clause succeeds,
  typecase returns nil.  A TYPE of t or `otherwise' is allowed only in the
! final clause, and matches if no other keys match.
! \n(fn EXPR (TYPE BODY...)...)"
    (let* ((temp (if (cl-simple-expr-p expr 3) expr (make-symbol "--cl-var--")))
         (type-list nil)
         (body (cons
***************
*** 552,558 ****
  
  (defmacro etypecase (expr &rest clauses)
    "Like `typecase', but error if no case fits.
! `otherwise'-clauses are not allowed."
    (list* 'typecase expr (append clauses '((ecase-error-flag)))))
  
  
--- 555,562 ----
  
  (defmacro etypecase (expr &rest clauses)
    "Like `typecase', but error if no case fits.
! `otherwise'-clauses are not allowed.
! \n(fn EXPR (TYPE BODY...)...)"
    (list* 'typecase expr (append clauses '((ecase-error-flag)))))
  
  
***************
*** 1273,1279 ****
  (defmacro progv (symbols values &rest body)
    "Bind SYMBOLS to VALUES dynamically in BODY.
  The forms SYMBOLS and VALUES are evaluated, and must evaluate to lists.
! Each SYMBOL in the first list is bound to the corresponding VALUE in the
  second list (or made unbound if VALUES is shorter than SYMBOLS); then the
  BODY forms are executed and their result is returned.  This is much like
  a `let' form, except that the list of symbols can be computed at run-time."
--- 1277,1283 ----
  (defmacro progv (symbols values &rest body)
    "Bind SYMBOLS to VALUES dynamically in BODY.
  The forms SYMBOLS and VALUES are evaluated, and must evaluate to lists.
! Each symbol in the first list is bound to the corresponding value in the
  second list (or made unbound if VALUES is shorter than SYMBOLS); then the
  BODY forms are executed and their result is returned.  This is much like
  a `let' form, except that the list of symbols can be computed at run-time."
***************
*** 1284,1290 ****
  
  ;;; This should really have some way to shadow 'byte-compile properties, etc.
  (defmacro flet (bindings &rest body)
!   "Make temporary function defns.
  This is an analogue of `let' that operates on the function cell of FUNC
  rather than its value cell.  The FORMs are evaluated with the specified
  function definitions in place, then the definitions are undone (the FUNCs
--- 1288,1294 ----
  
  ;;; This should really have some way to shadow 'byte-compile properties, etc.
  (defmacro flet (bindings &rest body)
!   "Make temporary function definitions.
  This is an analogue of `let' that operates on the function cell of FUNC
  rather than its value cell.  The FORMs are evaluated with the specified
  function definitions in place, then the definitions are undone (the FUNCs
***************
*** 1311,1317 ****
         body))
  
  (defmacro labels (bindings &rest body)
!   "Make temporary func bindings.
  This is like `flet', except the bindings are lexical instead of dynamic.
  Unlike `flet', this macro is fully compliant with the Common Lisp standard.
  
--- 1315,1321 ----
         body))
  
  (defmacro labels (bindings &rest body)
!   "Make temporary function bindings.
  This is like `flet', except the bindings are lexical instead of dynamic.
  Unlike `flet', this macro is fully compliant with the Common Lisp standard.
  
***************
*** 1369,1375 ****
  (defmacro lexical-let (bindings &rest body)
    "Like `let', but lexically scoped.
  The main visible difference is that lambdas inside BODY will create
! lexical closures as in Common Lisp."
    (let* ((cl-closure-vars cl-closure-vars)
         (vars (mapcar (function
                        (lambda (x)
--- 1373,1380 ----
  (defmacro lexical-let (bindings &rest body)
    "Like `let', but lexically scoped.
  The main visible difference is that lambdas inside BODY will create
! lexical closures as in Common Lisp.
! \n(fn VARLIST BODY)"
    (let* ((cl-closure-vars cl-closure-vars)
         (vars (mapcar (function
                        (lambda (x)
***************
*** 1411,1417 ****
  (defmacro lexical-let* (bindings &rest body)
    "Like `let*', but lexically scoped.
  The main visible difference is that lambdas inside BODY will create
! lexical closures as in Common Lisp."
    (if (null bindings) (cons 'progn body)
      (setq bindings (reverse bindings))
      (while bindings
--- 1416,1423 ----
  (defmacro lexical-let* (bindings &rest body)
    "Like `let*', but lexically scoped.
  The main visible difference is that lambdas inside BODY will create
! lexical closures as in Common Lisp.
! \n(fn VARLIST BODY)"
    (if (null bindings) (cons 'progn body)
      (setq bindings (reverse bindings))
      (while bindings
***************
*** 1435,1441 ****
  simulate true multiple return values.  For compatibility, (values A B C) is
  a synonym for (list A B C).
  
! \(fn (SYM SYM...) FORM BODY)"
    (let ((temp (make-symbol "--cl-var--")) (n -1))
      (list* 'let* (cons (list temp form)
                       (mapcar (function
--- 1441,1447 ----
  simulate true multiple return values.  For compatibility, (values A B C) is
  a synonym for (list A B C).
  
! \(fn (SYM...) FORM BODY)"
    (let ((temp (make-symbol "--cl-var--")) (n -1))
      (list* 'let* (cons (list temp form)
                       (mapcar (function
***************
*** 1451,1457 ****
  `multiple-value-setq' macro, using lists to simulate true multiple return
  values.  For compatibility, (values A B C) is a synonym for (list A B C).
  
! \(fn (SYM SYM...) FORM)"
    (cond ((null vars) (list 'progn form nil))
        ((null (cdr vars)) (list 'setq (car vars) (list 'car form)))
        (t
--- 1457,1463 ----
  `multiple-value-setq' macro, using lists to simulate true multiple return
  values.  For compatibility, (values A B C) is a synonym for (list A B C).
  
! \(fn (SYM...) FORM)"
    (cond ((null vars) (list 'progn form nil))
        ((null (cdr vars)) (list 'setq (car vars) (list 'car form)))
        (t
***************
*** 1967,1973 ****
  Example: (shiftf A B C) sets A to B, B to C, and returns the old A.
  Each PLACE may be a symbol, or any generalized variable allowed by `setf'.
  
! \(fn PLACE PLACE... VAL)"
    (cond
     ((null args) place)
     ((symbolp place) `(prog1 ,place (setq ,place (shiftf ,@args))))
--- 1973,1979 ----
  Example: (shiftf A B C) sets A to B, B to C, and returns the old A.
  Each PLACE may be a symbol, or any generalized variable allowed by `setf'.
  
! \(fn PLACE... VAL)"
    (cond
     ((null args) place)
     ((symbolp place) `(prog1 ,place (setq ,place (shiftf ,@args))))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]