Subject: Re: Functions in Lisp
From: rpw3@rpw3.org (Rob Warnock)
Date: Thu, 23 Feb 2006 06:01:12 -0600
Newsgroups: comp.lang.lisp
Message-ID: <ZNidnS5IifOVOWDenZ2dnUVZ_sKdnZ2d@speakeasy.net>
Pascal Bourguignon  <usenet@informatimago.com> wrote:
+---------------
| "Kaz Kylheku" <kkylheku@gmail.com> writes:
| > There is no "forward declaration" in Lisp...
| 
| What about a  declaimation:
| (DECLAIM (FTYPE (FUNCTION (T) T) recursive))
+---------------

I've actually used that quite a bit to muffle CMUCL's compiler,
which likes to complain [harmlessly, but noisily] about both
forward references and also functions defined in other files
[that are not block-compiled together]. Since the arg & value
"type-spec"s are optional [see CLHS "System Class FUNCTION"],
you can leave off the full signatures and just supply the names
[which is convenient when you have a lot of them]:

    ;;; Shut up fwd-ref & external warnings:
    (declaim (ftype function mmap dump32 r8 r16 r32 w8 w16 w32
			     memcpy memcmp spin-until-change))


-Rob

-----
Rob Warnock			<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607