From: John Bentrup
Subject: proclaim/declaration problem
Date: 
Message-ID: <1992Mar12.170134.11420@m.cs.uiuc.edu>
I have some code that is running under Lucid CL, which I am now also running   
under Allegro.  Although it runs, I would like to turn off some of the
compiler warnings about implementation dependent items.  I tried "declaration",
but, for example, Lucid still squawks about 'Package "EXCL" not found'.
Briefly this is what I have...

(defconstant *LISP-TYPE* (lisp-implementation-type))
(proclaim '(declaration excl:*global-gc-behavior* *gc-silence*))

(defun CLEAR-SYSTEM (run-number) 
  (cond ((equal *LISP-TYPE* "Lucid Common Lisp") 
	 (change-memory-management :reclamation-ratio 0.40)
	 (setf *gc-silence* T)
	 (gc))
	((equal *LISP-TYPE* "Allegro CL")
	 (setf excl:*global-gc-behavior* :auto)
	 (gc T))) 
  ;; other stuff
  )

I'm obviously not using "declaration" correctly.  Could someone help me
resolve this annoyance?  Thanks.

John
-- 
John Bentrup                                INTERNET: ·······@CS.UIUC.EDU
Department of Computer Science              BITNET: bentrup%uiucdcs.BITNET
University of Illinois at Urbana-Champaign  USENET: 
1304 W Springfield Ave			  {pur-ee,convex,ihnp4}!uiucdcs!bentrup

From: John Bentrup
Subject: Re: proclaim/declaration problem
Date: 
Message-ID: <1992Mar12.184657.23083@m.cs.uiuc.edu>
·······@m.cs.uiuc.edu (John Bentrup) writes:
>I have some code that is running under Lucid CL, which I am now also running   
>under Allegro.  Although it runs, I would like to turn off some of the
>compiler warnings about implementation dependent items.  I tried "declaration",

Thanks to all who pointed out that the better way to include
implementation dependent code was at READ time rather than RUN time.
So one way suggested was...

(defun CLEAR-SYSTEM (run-number) 
  #+LUCID (progn (change-memory-management :reclamation-ratio 0.40)
		 (setf *gc-silence* T)
		 (gc))
  #+EXCL (progn
	   (setf excl:*global-gc-behavior* :auto)
	   (gc T)) 
  ;; other stuff
  )

Where the keywords (LUCID and EXCL) come from the *FEATURES* variable. 

Thanks again.

-- 
John Bentrup                                INTERNET: ·······@CS.UIUC.EDU
Department of Computer Science              BITNET: bentrup%uiucdcs.BITNET
University of Illinois at Urbana-Champaign  USENET: 
1304 W Springfield Ave			  {pur-ee,convex,ihnp4}!uiucdcs!bentrup
From: Randy Coulman
Subject: Re: proclaim/declaration problem
Date: 
Message-ID: <1992Mar12.185524.10103@access.usask.ca>
In article <······················@m.cs.uiuc.edu>, ·······@m.cs.uiuc.edu (John Bentrup) writes:
>
>I have some code that is running under Lucid CL, which I am now also running   
>under Allegro.  Although it runs, I would like to turn off some of the
>compiler warnings about implementation dependent items.  I tried "declaration",
>but, for example, Lucid still squawks about 'Package "EXCL" not found'.
>Briefly this is what I have...
>
>(defconstant *LISP-TYPE* (lisp-implementation-type))
>(proclaim '(declaration excl:*global-gc-behavior* *gc-silence*))
>
>(defun CLEAR-SYSTEM (run-number) 
>  (cond ((equal *LISP-TYPE* "Lucid Common Lisp") 
>	 (change-memory-management :reclamation-ratio 0.40)
>	 (setf *gc-silence* T)
>	 (gc))
>	((equal *LISP-TYPE* "Allegro CL")
>	 (setf excl:*global-gc-behavior* :auto)
>	 (gc T))) 
>  ;; other stuff
>  )
>
>I'm obviously not using "declaration" correctly.  Could someone help me
>resolve this annoyance?  Thanks.
>
Try this instead:

(defun CLEAR-SYSTEM (run-number)
#+lucid
  (progn
    (change-memory-management :reclamation-ratio 0.40)
    (setf *gc-silence* T)
    (gc))
#+excl
  (progn
    (setf excl:*global-gc-behaviour* :auto)
    (gc T))
  ;; other stuff
  )

You should no longer need the declaration or the *LISP-TYPE* constant.
Using #+ (and #-) is the preferred way of writing implementation
dependant code.  I'm not sure if #+lucid is right for Lucid CL, but I
know that #+excl is right for Allegro.  Basically, if :excl is in the
list *features*, then the subsequent form is processed (which is why
I used a progn).  If :excl is not in *features*, the form is ignored.
As I said, I'm not sure what to use for Lucid.  It may be #+lcl.
Maybe someone else can say?

Randy
--
Randy A. Coulman                    |
Department of Computational Science | 
University of Saskatchewan          | ·······@cs.Usask.ca         
Saskatoon, SK   S7N 0W0             | ·······@skaries.Usask.ca
From: Skip Egdorf
Subject: Re: different vendor differentation (was: proclaim/declaration problem)
Date: 
Message-ID: <EGDORF.92Mar13165014@zaphod.lanl.gov>
In article <······················@access.usask.ca> ·······@cs.Usask.CA (Randy Coulman) writes:
   Using #+ (and #-) is the preferred way of writing implementation
   dependant code.  I'm not sure if #+lucid is right for Lucid CL, but I
   know that #+excl is right for Allegro.
   ...
   As I said, I'm not sure what to use for Lucid.  It may be #+lcl.
   Maybe someone else can say?

My code has the following in its machine dependant places:

#+lucid   (...) ; Sun Common Lisp 4.0.2
#+cloe    (...) ; CLOE 3.1
#+allegro (...) ; Allegro 4.1b
#+ccl     (...) ; MCL 2.0b
#+cmu     (...) ; CMU's Python Compiler

as these are the 5 lisps I currently support.
Any corrections or additions would be welcome.

By the way, PCL's defsys has a big section where is regularizes the
*features* list for a big bunch of machines.

					Skip Egdorf
					···@lanl.gov