-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
CL-PATTERN has optimize proclaimation.
It causes unwanted change of compile policy at load-time.
> (declaim (optimize (speed 1) debug safety))
NIL
> (ccl:declaration-information 'optimize)
((SPEED 1) (SAFETY 3) (COMPILATION-SPEED 1) (SPACE 1) (DEBUG 3))
> (ql:quickload :cl-pattern)
To load "cl-pattern":
Load 1 ASDF system:
cl-pattern
; Loading "cl-pattern"
(:CL-PATTERN)
> (ccl:declaration-information 'optimize)
((SPEED 3) (SAFETY 3) (COMPILATION-SPEED 1) (SPACE 1) (DEBUG 3))
There are some better ways for optimize declaration:
;; Use declare in each functions
(defun f ()
(declare (optimize speed))
...)
;; Use locally at top level and surround function definitions with it
(locally (declare (optimize speed))
(defun x () ...)
(defun y () ...))
;; Proclaim optimize declaration at only compile-time
(eval-when (:compile-toplevel)
(proclaim '(optimize speed)))
References:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels