From c971696d040d9d7411a1ceeaf57e7c8e0ba490bf Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Sun, 8 Feb 2004 22:41:39 +0000 Subject: (defstruct): Remove extra format string argument. (cl-struct-setf-expander): Likewise. --- lisp/emacs-lisp/cl-macs.el | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'lisp/emacs-lisp/cl-macs.el') diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 038786bb944..6a6b006c2ba 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -1,6 +1,6 @@ ;;; cl-macs.el --- Common Lisp macros -*-byte-compile-dynamic: t;-*- -;; Copyright (C) 1993, 2003 Free Software Foundation, Inc. +;; Copyright (C) 1993, 2003, 2004 Free Software Foundation, Inc. ;; Author: Dave Gillespie ;; Version: 2.02 @@ -2261,8 +2261,7 @@ copier, a `NAME-p' predicate, and setf-able `NAME-SLOT' accessors. (list (list 'or pred-check (list 'error (format "%s accessing a non-%s" - accessor name) - 'cl-x)))) + accessor name))))) (list (if (eq type 'vector) (list 'aref 'cl-x pos) (if (= pos 0) '(car cl-x) (list 'nth pos 'cl-x)))))) forms) @@ -2340,8 +2339,7 @@ copier, a `NAME-p' predicate, and setf-able `NAME-SLOT' accessors. (list (list 'or (subst temp 'cl-x pred-form) (list 'error (format - "%s storing a non-%s" accessor name) - temp)))) + "%s storing a non-%s" accessor name))))) (list (if (eq (car (get name 'cl-struct-type)) 'vector) (list 'aset temp pos store) (list 'setcar -- cgit v1.2.3 From a766dfa1042f538843b2da50683528589ce68180 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Sat, 8 May 2004 17:23:08 +0000 Subject: (do, do*): Put usage info in a format usable by `describe-function'. (gensym, gentemp, typep, ignore-errors): Make argument names match their use in docstring. --- lisp/emacs-lisp/cl-macs.el | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'lisp/emacs-lisp/cl-macs.el') diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 6a6b006c2ba..286c7632ed8 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -164,21 +164,21 @@ ;;; Symbols. (defvar *gensym-counter*) -(defun gensym (&optional arg) +(defun gensym (&optional prefix) "Generate a new uninterned symbol. The name is made by appending a number to PREFIX, default \"G\"." - (let ((prefix (if (stringp arg) arg "G")) - (num (if (integerp arg) arg + (let ((pfix (if (stringp prefix) prefix "G")) + (num (if (integerp prefix) prefix (prog1 *gensym-counter* (setq *gensym-counter* (1+ *gensym-counter*)))))) - (make-symbol (format "%s%d" prefix num)))) + (make-symbol (format "%s%d" pfix num)))) -(defun gentemp (&optional arg) +(defun gentemp (&optional prefix) "Generate a new interned symbol with a unique name. The name is made by appending a number to PREFIX, default \"G\"." - (let ((prefix (if (stringp arg) arg "G")) + (let ((pfix (if (stringp prefix) prefix "G")) name) - (while (intern-soft (setq name (format "%s%d" prefix *gensym-counter*))) + (while (intern-soft (setq name (format "%s%d" pfix *gensym-counter*))) (setq *gensym-counter* (1+ *gensym-counter*))) (intern name))) @@ -1177,12 +1177,14 @@ Valid clauses are: (defmacro do (steps endtest &rest body) "The Common Lisp `do' loop. -Format is: (do ((VAR INIT [STEP])...) (END-TEST [RESULT...]) BODY...)" + +\(fn ((VAR INIT [STEP])...) (END-TEST [RESULT...]) BODY...)" (cl-expand-do-loop steps endtest body nil)) (defmacro do* (steps endtest &rest body) "The Common Lisp `do*' loop. -Format is: (do* ((VAR INIT [STEP])...) (END-TEST [RESULT...]) BODY...)" + +\(fn ((VAR INIT [STEP])...) (END-TEST [RESULT...]) BODY...)" (cl-expand-do-loop steps endtest body t)) (defun cl-expand-do-loop (steps endtest body star) @@ -2398,10 +2400,10 @@ The type name can then be used in `typecase', `check-type', etc." ((eq (car type) 'satisfies) (list (cadr type) val)) (t (error "Bad type spec: %s" type))))) -(defun typep (val type) ; See compiler macro below. +(defun typep (object type) ; See compiler macro below. "Check that OBJECT is of type TYPE. TYPE is a Common Lisp-style type specifier." - (eval (cl-make-type-test 'val type))) + (eval (cl-make-type-test 'object type))) (defmacro check-type (form type &optional string) "Verify that FORM is of type TYPE; signal an error if not. @@ -2438,8 +2440,8 @@ omitted, a default message listing FORM itself is used." nil)))) (defmacro ignore-errors (&rest body) - "Execute FORMS; if an error occurs, return nil. -Otherwise, return result of last FORM." + "Execute BODY; if an error occurs, return nil. +Otherwise, return result of last form in BODY." `(condition-case nil (progn ,@body) (error nil))) -- cgit v1.2.3