28.02.2014 Views

Burke_et_al-NIL_Reference_Manual_0286-1984

Burke_et_al-NIL_Reference_Manual_0286-1984

Burke_et_al-NIL_Reference_Manual_0286-1984

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Prcdic4Jtes 16 Nil. Mamml<br />

4. Predicates<br />

4.1 Type Predicates<br />

4. J.I Type Specifiers<br />

A type specifier is an expression which may be used to exprcs.~ a data-type constraint.<br />

nil No object is of the type nit: nif is a subtype of aU types.<br />

t All objects arc of the type 1. For· instctncc.<br />

(make-array ·(10 10) :.element-type t)<br />

m~tkcs an 10xl0 ~lrmy which can huld objects of any type.<br />

tJt,c-name<br />

This is the most common fhnn of type specifier; just a type name. filr insumcc number.<br />

double-float. string. IJ1'('-llilmemay be .the name of 1 flavor defined with defflavor<br />

(page 173). the name of a stnJcture defined by defstruct {page 125) (assuming defstruct<br />

is not told to implement the stnlcturc in some other fashion). or one of the m,my <strong>NIL</strong><br />

types noted in various places in this document<br />

(not type-specijiery<br />

AU objects which are not of type type-specifier.<br />

Carto !s! !s2 ... IS!?)<br />

The intersection of the types corresponding to the given type spccifiers~<br />

(or lsi Is) •.. tsn)<br />

The union of the types corresponding to the given type sp~jfiers.<br />

(member x) xl ... XIl)<br />

This describes a type which is one of the objects xl, xl, ... xiz. Equ<strong>al</strong>ity is defined by<br />

eql (page 20).<br />

(satisfiesjUnclion-name)<br />

An object is a ttmember" of this type if junction-name r<strong>et</strong>urns a non-null v<strong>al</strong>ue when<br />

applied to it, otherwise it is not.<br />

. There are some more complex fonns which are used variously as synonyms for, and<br />

constraints on. more gener<strong>al</strong> types. For instance:<br />

(integer low high)<br />

An object is of this type if it is an integer b<strong>et</strong>ween low and high. low and high may be<br />

integers. in which case the boundary check is illclusive, lists of integers. in which case the<br />

boundary check is exclusive. or the atom ., which signifies infinity of the appropriate<br />

sign. Thus. (integer 0 .) is a type specifier for <strong>al</strong>l non-negative integers. and (integer<br />

(0) .) or (integer 1 .) for <strong>al</strong>l positive integers.<br />

(signed - byte size)<br />

(unsigned - byte size)<br />

An object is of these types if it can be r.cprcscnted in the appropriate fonn in twos-<br />

MC:<strong>NIL</strong>MAN:PRElJ 29<br />

23-DEC-83<br />

, .. ~ , - ~<br />

-,.:,:c ".,~> .. ); ". }': ..', J'-. : : " ',' ~<br />

,<br />

,.... .' ,". . ~.<br />

,

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!