From: Marty Hall
Subject: Finding current optimization settings
Date: 
Message-ID: <C8rp0t.zM@aplcenmp.apl.jhu.edu>
I want to write a function that, as part of what it does, compiles 
a file with high optimization settings. Eg

(defun Compile-File-Fast (File)
  (proclaim '(optimize (speed 3) (safety 1) (compilation-speed 0)))
  (compile-file File)
  ;; ????
)

However, I want to leave the optimization settings at whatever state
they were before. Unfortunately, I cannot figure out how to either:

(A) Portably find the current optimization settings in order to record
    them before changing, so I can change back after the compilation, or

(B) Find a command that makes the settings locally but works for
    compiling the file. As far as I can tell, neither DECLARE nor
    DECLAIM will do this.

Am I missing something obvious, am I trying to do something that I
shouldn't, or what? Thanks-
					- Marty
(proclaim '(inline skates))
---

From: Rainer Joswig
Subject: Re: Finding current optimization settings
Date: 
Message-ID: <joswig-180693094600@kimac1.informatik.uni-hamburg.de>
In article <·········@aplcenmp.apl.jhu.edu>, ····@aplcenmp.apl.jhu.edu
(Marty Hall) wrote:
> However, I want to leave the optimization settings at whatever state
> they were before. Unfortunately, I cannot figure out how to either:
> 
> (A) Portably find the current optimization settings in order to record
>     them before changing, so I can change back after the compilation, or

Use the function DECLARATION-INFORMATION (CLtL2, page 210).

Rainer Joswig
······@informatik.uni-hamburg.de
From: Eyvind Ness
Subject: Re: Finding current optimization settings
Date: 
Message-ID: <EYVIND.93Jun18121652@bingen.hrp.no>
In article <···················@kimac1.informatik.uni-hamburg.de> ······@informatik.uni-hamburg.de (Rainer Joswig) writes:

   Newsgroups: comp.lang.lisp
   Path: bingen.hrp.no!dhhalden.no!nuug!news.eunet.no!trane.uninett.no!sunic!uunet!haven.umd.edu!darwin.sura.net!news.dfn.de!rzsun2.informatik.uni-hamburg.de!kimac1.informatik.uni-hamburg.de!user
   From: ······@informatik.uni-hamburg.de (Rainer Joswig)
   Followup-To: comp.lang.lisp
   Sender: ····@informatik.uni-hamburg.de (Mr. News)
   Organization: University of Hamburg, Germany
   References: <·········@aplcenmp.apl.jhu.edu>
   Date: Fri, 18 Jun 1993 07:53:29 GMT
   Lines: 12

   In article <·········@aplcenmp.apl.jhu.edu>, ····@aplcenmp.apl.jhu.edu
   (Marty Hall) wrote:
   > However, I want to leave the optimization settings at whatever state
   > they were before. Unfortunately, I cannot figure out how to either:
   > 
   > (A) Portably find the current optimization settings in order to record
   >     them before changing, so I can change back after the compilation, or

   Use the function DECLARATION-INFORMATION (CLtL2, page 210).

According to my Allegro CL User Guide, vol 2, page A-42, item #328,
X3J13 later decided that the environment-enquiry functions,
VARIABLE-INFORMATION, FUNCTION-INFORMATION, DECLARATION-INFORMATION,
AGMENT-ENVIRONMENT, DEFINE-DECLARATION, PARSE-MACRO, and ENCLOSE, should
be removed from the standards proposal due to "serious consitency
problems".
--
 Eyvind Ness, Research Scientist, OECD Halden Reactor Project, Norway.

 ~/.signature: No such file or directory ;-)
From: Sandra Loosemore
Subject: Re: Finding current optimization settings
Date: 
Message-ID: <1vsvc0INNqoq@FUNCTOR.SYSTEMSZ.CS.YALE.EDU>
······@hrp.no (Eyvind Ness) writes:

   According to my Allegro CL User Guide, vol 2, page A-42, item #328,
   X3J13 later decided that the environment-enquiry functions,
   VARIABLE-INFORMATION, FUNCTION-INFORMATION, DECLARATION-INFORMATION,
   AGMENT-ENVIRONMENT, DEFINE-DECLARATION, PARSE-MACRO, and ENCLOSE, should
   be removed from the standards proposal due to "serious consitency
   problems".

Well, that's not quite what happened.  We found that, after adding the
ability to define declarations with arbitrary syntax with
DEFINE-DECLARATION, we also needed an additional function
PARSE-DECLARATIONS, so that you could sort out which declarations in a
LET* belonged to which bindings, for example.  Rather than add this
function, the committee decided to remove the entire environment
access facility.  It appears that many of the committee members were
put off by the complexity of the issues involved and just didn't want
to have to deal with it.

Personally, I'm of the opinion that the committee threw out the baby
with the bath water.  The environment inquiry functions are certainly
useful by themselves even if you don't have the facilities for defining
your own declarations, or for writing portable code walkers.

-Sandra
From: Barry Margolin
Subject: Re: Finding current optimization settings
Date: 
Message-ID: <9306181623.AA11781@telecaster.think.com>
In article <·········@aplcenmp.apl.jhu.edu> you write:
>(A) Portably find the current optimization settings in order to record
>    them before changing, so I can change back after the compilation, or
>(B) Find a command that makes the settings locally but works for
>    compiling the file. As far as I can tell, neither DECLARE nor
>    DECLAIM will do this.

These can't be done portably.
-- 
Barry Margolin
System Manager, Thinking Machines Corp.

······@think.com          {uunet,harvard}!think!barmar