Reinstate "Change layout bitmap so that 0 = raw, 1 = tagged"
[sbcl.git] / tests / properties.impure.lisp
blob51519d70b15fb1a75756c832a7e7d0fd42ddcbce
1 ;;;; miscellaneous tests of symbol properties
3 ;;;; This software is part of the SBCL system. See the README file for
4 ;;;; more information.
5 ;;;;
6 ;;;; While most of SBCL is derived from the CMU CL system, the test
7 ;;;; files (like this one) were written from scratch after the fork
8 ;;;; from CMU CL.
9 ;;;;
10 ;;;; This software is in the public domain and is provided with
11 ;;;; absolutely no warranty. See the COPYING and CREDITS files for
12 ;;;; more information.
14 (in-package "CL-USER")
16 (defun test-symbol (symbol)
17 (setf (symbol-plist symbol) nil)
18 (setf (get symbol 'foo) '(my list))
19 (setf (get symbol 'bar) 10)
20 (setf (get symbol 'baz) t)
21 (assert (eql (get symbol 'bar) 10))
22 (assert (= (length (symbol-plist symbol)) 6))
23 (remprop symbol 'foo)
24 (assert (not (get symbol 'foo))))
25 (mapc #'test-symbol '(foo :keyword || t nil))
26 ;;; In early 0.7 versions on non-x86 ports, setting the property list
27 ;;; of 'NIL would trash (CDR NIL), due to a screwup in the low-level
28 ;;; layout of SYMBOL. (There are several low-level punnish tricks used
29 ;;; to make NIL work both as a cons and as a symbol without requiring
30 ;;; a lot of conditional branching at runtime.)
31 (defparameter *nil-that-the-compiler-cannot-constant-fold* nil)
32 (assert (not (car *nil-that-the-compiler-cannot-constant-fold*)))
33 (assert (not (cdr *nil-that-the-compiler-cannot-constant-fold*)))
35 ;;; success