Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Details of GNU Common Lisp's (type-of)

If at the REPL I enter:

(type-of (make-array 5))

then I get the response:

(SIMPLE-VECTOR 5)

Fair enough. So if at the REPL I enter:

(type-of (make-array (list 5 3 2)))

then I get the response:

(SIMPLE-ARRAY T (5 3 2))

I have two questions.

  1. What is the T telling me here? If it had been NIL instead, what would that have told me?
  2. Where could I have found this answer on my own? I failed to find the answer in (for example) the Lisp HyperSpec.
like image 567
Bill Evans at Mariposa Avatar asked Jan 19 '23 03:01

Bill Evans at Mariposa


1 Answers

(SIMPLE-ARRAY T (5 3 2)) is a simple array of three dimensions. T says that it is a general array which can contain any element type. T is the most general type.

The hyperspec documents the type SIMPLE-ARRAY here:

http://www.lispworks.com/documentation/HyperSpec/Body/t_smp_ar.htm

like image 86
Rainer Joswig Avatar answered Jan 26 '23 20:01

Rainer Joswig