What, for example, do you think #0AFFFF represents?
Perhaps you're thinking of the color turquoise represented as a hexadecimal RGB value?
Well, witness for yourself:
CL-USER> (setf *read-base* 16)(Bonus point if you know how to restore *READ-BASE* to a value of 10 again.)
16
CL-USER> #0AFFFF
#0A65535
Still no idea?
CL-USER> (type-of *)Right, #0AFOO is literal syntax for (make-array nil :initial-element 'foo).
(SIMPLE-ARRAY T NIL)
And, yeah, even though Common Lisp is surely a complex beast, it's at the same time very well engineered. Witness thus:
CL-USER> (defvar *a*And if you want to see really quirky stuff, take a look at strings with an element-type of nil.
(make-array nil :initial-element 41))
*A*
CL-USER> (incf (aref *a*))
42
CL-USER> *a*
#0A42
No comments:
Post a Comment