In article <··········@uni.library.ucla.edu>, "John L. Stein"
<·····@seas.ucla.edu> wrote:
> I need to declare a local variable of type "vertex"
> so that I can (set! vert jkl)
>
> Thanks
> -js
(defun a-function (arg-0)
(let ( (foo <some appropriate vertex value>) )
(declare (vertex foo))
<body of function>))
in other words, #'let allows you to include a declaration form within the
let form. It must appear at the beginning of the let form (right after the
list of variable - value pairs).
Is this what you're asking?
Raf
In article <························@macav.tiac.net>
·······@tiac.net (Raffael Cavallaro) writes:
(defun a-function (arg-0)
(let ( (foo <some appropriate vertex value>) )
(declare (vertex foo))
<body of function>))
Of course, that `declare' should be
(declare (type vertex foo))
^^^^
Abbreviating
(TYPE type var1 var2 ...)
as simply
(type var1 var2 ...)
is allowed *only* for a number of predefined types.
--Vassili
Vassili Bykov wrote:
>
> In article <························@macav.tiac.net>
> ·······@tiac.net (Raffael Cavallaro) writes:
>
> (defun a-function (arg-0)
> (let ( (foo <some appropriate vertex value>) )
> (declare (vertex foo))
> <body of function>))
>
> Of course, that `declare' should be
>
> (declare (type vertex foo))
> ^^^^
> Abbreviating
>
> (TYPE type var1 var2 ...)
>
> as simply
>
> (type var1 var2 ...)
>
> is allowed *only* for a number of predefined types.
>
> --Vassili
Actually, the abbreviation is allowed for both implementation and user
defined types in ANSI. See:
http://www.harlequin.com/books/HyperSpec/Body/dec_type.html
http://www.harlequin.com/books/HyperSpec/Issues/iss350-writeup.html