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

1Question about declaration0



    Date: Fri, 11 Dec 87 10:54 EST
    From: Robert W. Kerns <RWK@yukon.scrc.symbolics.com>

	Date: Fri, 11 Dec 87 01:16 EST
	From: Brad Miller <miller@ACORN.CS.ROCHESTER.EDU>

       1How would you write a function declaration for the following?

0       1(defun foo (bar)
0	       1(declare (type list bar))
0	       1(values-list bar)

0       1(proclaim '(function foo (list) ????))

0    I wouldn't.  CL doesn't have any syntax for declaring
    a variable number of values, period.

The &optional, &rest, and &key markers may appear in the value-type list
for the values type-specifier.  p 48, CLtL.

The value-type for the function type-specifier may be a values type specifier.
p 47 CLtL

Therefore
One can say (function (number) (values number &optional float)), 
to specify that a function returns a variable number of values.

But, It doesnt mean that anyone will listen to the declaration, 
just because you can say it.

-jeff