Lisp HUG Maillist Archive

Trivial question.

Hello,

When compiling the following code:

(defun test (x)
  (declare (optimize (safety 0) (speed 3) (debug 0))
           (type fixnum x))
  x)

I got the following:
;;; Safety = 3, Speed = 1, Space = 1, Float = 1, Interruptible = 1
;;; Compilation speed = 1, Debug = 2, Fixnum safety = 3
;;; Source level debugging is on
;;; Source file recording is  on
;;; Cross referencing is on
; (TOP-LEVEL-FORM 0)
; TEST

... while the disassebly seems to show the effect of declarations.
So, why the output shows Safety = 3, Speed = 1 ... ?

Re: Trivial question.

Dmitry Igrishin <dfigrish@gmail.com> writes:

> Hello,
>
> When compiling the following code:
>
> (defun test (x)
> (declare (optimize (safety 0) (speed 3) (debug 0))
> (type fixnum x))
> x)
>
> I got the following:
> ;;; Safety = 3, Speed = 1, Space = 1, Float = 1, Interruptible = 1
> ;;; Compilation speed = 1, Debug = 2, Fixnum safety = 3
> ;;; Source level debugging is on
> ;;; Source file recording is on
> ;;; Cross referencing is on
> ; (TOP-LEVEL-FORM 0)
> ; TEST
>
> ... while the disassebly seems to show the effect of declarations.
> So, why the output shows Safety = 3, Speed = 1 ... ?

Because the output shows the settings before compiling the function, the
global settings.


-- 
__Pascal Bourguignon__                 http://www.informatimago.com/
“The factory of the future will have only two employees, a man and a
dog. The man will be there to feed the dog. The dog will be there to
keep the man from touching the equipment.” -- Carl Bass CEO Autodesk

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Updated at: 2020-12-10 08:32 UTC