[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Issue: PROCLAIM-SCOPE (Version 1)



> Proposal (PROCLAIM-SCOPE:ADD-KEYWORD-PERVASIVE):
> 
>   Introduce a :LOCALLY keyword parameter to PROCLAIM which controls
>   the scope of a proclamation.
> 
>   (PROCLAIM proclamation :LOCALLY T)
>     In a file, this would put the PROCLAMATION into effect for the entire
>     rest of time during which the file was being loaded (including
>     recursive loads).

While being loaded or while being compiled?  Most PROCLAIMs affect what
happens at compile-time, not load time.

>     Interactively, it would be the same as :LOCALLY NIL.

This probably should be considered an error since it isn't meaningful, but
some implementations might give it a meaning, such as being local to the
current process.

> Proposal (PROCLAIM-SCOPE:ADD-KEYWORD-NON-PERVASIVE):
> 
>   Introduce a :LOCALLY keyword parameter to PROCLAIM which controls
>   the scope of a proclamation.
> 
>   (PROCLAIM proclamation :LOCALLY T)
>     In a file, this would put the PROCLAMATION into effect for the entire
>     rest of the current file. Recursive loads or compilations would rebind
>     this to the global default.
> 
>     Interactively, this would affect interactive work but would not 
>     affect the default for files loaded.

This approach sounds more like what the user would expect (like lexical
scoping instead of dynamic scoping), although it would be a little harder
to implement.

>   Macsyma has a lot of files which do (PROCLAIM '(SPECIAL ...)) at the
>   top of the file and then does an implementation-specific
>   (PROCLAIM '(UNSPECIAL ...)) at the bottom for implementations that
>   support it. It would be both more modular and more portable to do
>   something such as what is proposed here.

This doesn't seem to be a very convincing example.  There shouldn't be any
need to routinely undo SPECIAL declarations if packages are being used
correctly.

> Current Practice:
> 
>   Symbolics Cloe binds optimization qualities (SAFETY, SPEED, 
>   COMPILATION-SPEED) in file compilations and doesn't allow
>   them to affect the global default.

Likewise on the TI Explorer. (PROCLAIM '(OPTIMIZE ...)) affects the
compilation but is not included in the object file.  (PROCLAIM '(SPECIAL
...) doesn't affect the global environment until the object file is
loaded.

--

This issue interacts with the EVAL-WHEN problems being considered by the
compiler committee.  If EVAL-WHEN can be extended and/or clarified to
permit specifying actions local to COMPILE-FILE, that might make an
extension to PROCLAIM unnecessary.

  -- David Gray