From 7e786529b02ccbba318ce6987e0bbebf405de5db Mon Sep 17 00:00:00 2001 From: ram <ram> Date: Sat, 6 Oct 1990 18:28:11 +0000 Subject: [PATCH] Added DECLAIM macro. Changed OPTIMIZE declaration to allow any real instead of just rationals, anticipating a possible change to float qualities. Changed OPTIMIZE to recognize EXT:INHIBIT-WARNINGS as the same as BREVITY. Changed DEBUG-INFO default to 2. --- compiler/proclaim.lisp | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/compiler/proclaim.lisp b/compiler/proclaim.lisp index 6b6988615..0799798a6 100644 --- a/compiler/proclaim.lisp +++ b/compiler/proclaim.lisp @@ -13,7 +13,14 @@ ;;; ;;; Written by Rob MacLachlan ;;; -(in-package 'c) +(in-package "C") + +(in-package "EXTENSIONS") +(export '(inhibit-warnings)) +(in-package "LISP") +(export '(declaim proclaim)) +(in-package "C") + ;;; True if the type system has been properly initialized, and thus is o.k. to ;;; use. @@ -38,7 +45,7 @@ ;;; (proclaim '(type cookie *default-cookie*)) (defvar *default-cookie* (make-cookie :safety 1 :speed 1 :space 1 :cspeed 1 - :brevity 1 :debug 1)) + :brevity 1 :debug 2)) ;;; Parse-Lambda-List -- Interface @@ -169,14 +176,14 @@ (dolist (quality (cdr spec)) (let ((quality (if (atom quality) (list quality 3) quality))) (if (and (consp (cdr quality)) (null (cddr quality)) - (rationalp (second quality)) (<= 0 (second quality) 3)) - (let ((value (second quality))) + (typep (second quality) 'real) (<= 0 (second quality) 3)) + (let ((value (rational (second quality)))) (case (first quality) (speed (setf (cookie-speed res) value)) (space (setf (cookie-space res) value)) (safety (setf (cookie-safety res) value)) (compilation-speed (setf (cookie-cspeed res) value)) - (brevity (setf (cookie-brevity res) value)) + ((inhibit-warnings brevity) (setf (cookie-brevity res) value)) (debug-info (setf (cookie-debug res) value)) (t (compiler-warning "Unknown optimization quality ~S in ~S." @@ -186,16 +193,24 @@ quality spec)))) res)) + +;;; DECLAIM -- Public +;;; +;;; For now, just PROCLAIM without any EVAL-WHEN. +;;; +(defmacro declaim (&rest specs) + "DECLAIM Declaration* + Do a declaration for the global environment." + `(progn ,@(mapcar #'(lambda (x) + `(proclaim ',x)) + specs))) + ;;; %Proclaim -- Interface ;;; ;;; This function is the guts of proclaim, since it does the global ;;; environment updating. ;;; -;;; ### At least for now, blow off type declarations when the compiler hasn't -;;; been loaded yet. This allows us to delay putting the type system into the -;;; cold load. -;;; (defun %proclaim (form) (unless (consp form) (error "Malformed PROCLAIM spec: ~S." form)) -- GitLab