Tema Lisp - Dpto. Ciencias de la Computación e Inteligencia Artificial.
Tema Lisp - Dpto. Ciencias de la Computación e Inteligencia Artificial.
Tema Lisp - Dpto. Ciencias de la Computación e Inteligencia Artificial.
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Predicados <strong>de</strong> tipos<br />
* (ATOM X)<br />
(atom 3) => T<br />
(atom ’ho<strong>la</strong>) => T<br />
(atom ’(1 2 3)) => NIL<br />
* (SYMBOLP X)<br />
(symbolp ’a) => T<br />
(symbolp 3) => NIL<br />
* (NUMBERP X)<br />
(numberp 4) => T<br />
(numberp 3.4) => T<br />
(numberp ’(1)) => NIL<br />
* (CONSP X)<br />
(consp ’(1 . 2))<br />
(consp nil)<br />
(consp ’(2 5))<br />
=> T<br />
=> NIL<br />
=> T<br />
* (NULL X)<br />
(null (rest ’(a b))) => NIL<br />
(null (rest ’(a))) => T<br />
IA-I 2003–2004 CcIa Introducción a <strong>Lisp</strong> <strong>Lisp</strong>.19