1 ;;;; various DEFSETFs, pulled into one file for convenience in doing
2 ;;;; them as early in the build process as possible so as to avoid
3 ;;;; hassles with invoking SETF FOO before DEFSETF FOO and thus
4 ;;;; compiling a call to some nonexistent function #'(SETF FOO)
6 ;;;; This software is part of the SBCL system. See the README file for
9 ;;;; This software is derived from the CMU CL system, which was
10 ;;;; written at Carnegie Mellon University and released into the
11 ;;;; public domain. The software is in the public domain and is
12 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
13 ;;;; files for more information.
15 (sb!int:/show0 "entering defsetfs.lisp")
17 ;;; from alieneval.lisp
18 (in-package "SB!ALIEN")
19 (defsetf slot %set-slot)
20 (defsetf deref (alien &rest indices) (value)
21 `(%set-deref ,alien ,value ,@indices))
22 (defsetf %heap-alien %set-heap-alien)
25 (in-package "SB!BIGNUM")
26 (defsetf %bignum-ref %bignum-set)
28 ;;; from bit-bash.lisp
30 (defsetf word-sap-ref %set-word-sap-ref)
32 ;;; from debug-int.lisp
34 (defsetf stack-ref %set-stack-ref)
35 (defsetf debug-var-value %set-debug-var-value)
36 (defsetf debug-var-value %set-debug-var-value)
37 (defsetf breakpoint-info %set-breakpoint-info)
39 ;;; from defstruct.lisp
40 (in-package "SB!KERNEL")
41 (defsetf %instance-ref %instance-set)
42 (defsetf %raw-ref-single %raw-set-single)
43 (defsetf %raw-ref-double %raw-set-double)
45 (defsetf %raw-ref-long %raw-set-long)
46 (defsetf %raw-ref-complex-single %raw-set-complex-single)
47 (defsetf %raw-ref-complex-double %raw-set-complex-double)
49 (defsetf %raw-ref-complex-long %raw-set-complex-long)
50 (defsetf %instance-layout %set-instance-layout)
51 (defsetf %funcallable-instance-info %set-funcallable-instance-info)
53 ;;; from early-setf.lisp
54 (in-package "SB!IMPL")
56 ;;; KLUDGE: Various of these (e.g. AREF and BIT) have DEFUN (SETF FOO) versions
57 ;;; too. Do we really need both? -- WHN 19990921
58 #-sb-xc-host (defsetf car %rplaca)
59 #-sb-xc-host (defsetf cdr %rplacd)
60 #-sb-xc-host (defsetf caar (x) (v) `(%rplaca (car ,x) ,v))
61 #-sb-xc-host (defsetf cadr (x) (v) `(%rplaca (cdr ,x) ,v))
62 #-sb-xc-host (defsetf cdar (x) (v) `(%rplacd (car ,x) ,v))
63 #-sb-xc-host (defsetf cddr (x) (v) `(%rplacd (cdr ,x) ,v))
64 #-sb-xc-host (defsetf caaar (x) (v) `(%rplaca (caar ,x) ,v))
65 #-sb-xc-host (defsetf cadar (x) (v) `(%rplaca (cdar ,x) ,v))
66 #-sb-xc-host (defsetf cdaar (x) (v) `(%rplacd (caar ,x) ,v))
67 #-sb-xc-host (defsetf cddar (x) (v) `(%rplacd (cdar ,x) ,v))
68 #-sb-xc-host (defsetf caadr (x) (v) `(%rplaca (cadr ,x) ,v))
69 #-sb-xc-host (defsetf caddr (x) (v) `(%rplaca (cddr ,x) ,v))
70 #-sb-xc-host (defsetf cdadr (x) (v) `(%rplacd (cadr ,x) ,v))
71 #-sb-xc-host (defsetf cdddr (x) (v) `(%rplacd (cddr ,x) ,v))
72 #-sb-xc-host (defsetf caaaar (x) (v) `(%rplaca (caaar ,x) ,v))
73 #-sb-xc-host (defsetf cadaar (x) (v) `(%rplaca (cdaar ,x) ,v))
74 #-sb-xc-host (defsetf cdaaar (x) (v) `(%rplacd (caaar ,x) ,v))
75 #-sb-xc-host (defsetf cddaar (x) (v) `(%rplacd (cdaar ,x) ,v))
76 #-sb-xc-host (defsetf caadar (x) (v) `(%rplaca (cadar ,x) ,v))
77 #-sb-xc-host (defsetf caddar (x) (v) `(%rplaca (cddar ,x) ,v))
78 #-sb-xc-host (defsetf cdadar (x) (v) `(%rplacd (cadar ,x) ,v))
79 #-sb-xc-host (defsetf cdddar (x) (v) `(%rplacd (cddar ,x) ,v))
80 #-sb-xc-host (defsetf caaadr (x) (v) `(%rplaca (caadr ,x) ,v))
81 #-sb-xc-host (defsetf cadadr (x) (v) `(%rplaca (cdadr ,x) ,v))
82 #-sb-xc-host (defsetf cdaadr (x) (v) `(%rplacd (caadr ,x) ,v))
83 #-sb-xc-host (defsetf cddadr (x) (v) `(%rplacd (cdadr ,x) ,v))
84 #-sb-xc-host (defsetf caaddr (x) (v) `(%rplaca (caddr ,x) ,v))
85 #-sb-xc-host (defsetf cadddr (x) (v) `(%rplaca (cdddr ,x) ,v))
86 #-sb-xc-host (defsetf cdaddr (x) (v) `(%rplacd (caddr ,x) ,v))
87 #-sb-xc-host (defsetf cddddr (x) (v) `(%rplacd (cdddr ,x) ,v))
88 #-sb-xc-host (defsetf first %rplaca)
89 #-sb-xc-host (defsetf second (x) (v) `(%rplaca (cdr ,x) ,v))
90 #-sb-xc-host (defsetf third (x) (v) `(%rplaca (cddr ,x) ,v))
91 #-sb-xc-host (defsetf fourth (x) (v) `(%rplaca (cdddr ,x) ,v))
92 #-sb-xc-host (defsetf fifth (x) (v) `(%rplaca (cddddr ,x) ,v))
93 #-sb-xc-host (defsetf sixth (x) (v) `(%rplaca (cdr (cddddr ,x)) ,v))
94 #-sb-xc-host (defsetf seventh (x) (v) `(%rplaca (cddr (cddddr ,x)) ,v))
95 #-sb-xc-host (defsetf eighth (x) (v) `(%rplaca (cdddr (cddddr ,x)) ,v))
96 #-sb-xc-host (defsetf ninth (x) (v) `(%rplaca (cddddr (cddddr ,x)) ,v))
97 #-sb-xc-host (defsetf tenth (x) (v) `(%rplaca (cdr (cddddr (cddddr ,x))) ,v))
98 #-sb-xc-host (defsetf rest %rplacd)
99 #-sb-xc-host (defsetf elt %setelt)
100 #-sb-xc-host (defsetf aref %aset)
101 #-sb-xc-host (defsetf row-major-aref %set-row-major-aref)
102 #-sb-xc-host (defsetf svref %svset)
103 #-sb-xc-host (defsetf char %charset)
104 #-sb-xc-host (defsetf bit %bitset)
105 #-sb-xc-host (defsetf schar %scharset)
106 #-sb-xc-host (defsetf sbit %sbitset)
107 (defsetf %array-dimension %set-array-dimension)
108 (defsetf sb!kernel:%raw-bits sb!kernel:%set-raw-bits)
109 #-sb-xc-host (defsetf symbol-value set)
110 #-sb-xc-host (defsetf symbol-function fset)
111 #-sb-xc-host (defsetf symbol-plist %set-symbol-plist)
112 #-sb-xc-host (defsetf nth %setnth)
113 #-sb-xc-host (defsetf fill-pointer %set-fill-pointer)
114 (defsetf sap-ref-8 %set-sap-ref-8)
115 (defsetf signed-sap-ref-8 %set-signed-sap-ref-8)
116 (defsetf sap-ref-16 %set-sap-ref-16)
117 (defsetf signed-sap-ref-16 %set-signed-sap-ref-16)
118 (defsetf sap-ref-32 %set-sap-ref-32)
119 (defsetf signed-sap-ref-32 %set-signed-sap-ref-32)
120 #!+alpha (defsetf sap-ref-64 %set-sap-ref-64)
121 #!+alpha (defsetf signed-sap-ref-64 %set-signed-sap-ref-64)
122 (defsetf sap-ref-sap %set-sap-ref-sap)
123 (defsetf sap-ref-single %set-sap-ref-single)
124 (defsetf sap-ref-double %set-sap-ref-double)
125 #!+long-float (defsetf sap-ref-long %set-sap-ref-long)
126 #-sb-xc-host (defsetf subseq (sequence start &optional (end nil)) (v)
127 `(progn (replace ,sequence ,v :start1 ,start :end1 ,end)
130 ;;; from fdefinition.lisp
131 (in-package "SB!IMPL")
132 #-sb-xc-host (defsetf fdefinition %set-fdefinition)
135 (in-package "SB!KERNEL")
136 (defsetf code-header-ref code-header-set)
137 (defsetf %raw-bits %set-raw-bits)
139 ;;; from serve-event.lisp
140 (in-package "SB!IMPL")
141 (defsetf object-set-operation %set-object-set-operation
143 "Set the handler function for an object set operation.")
147 (defsetf context-register %set-context-register)
148 (defsetf context-float-register %set-context-float-register)
150 (sb!int:/show0 "leaving defsetfs.lisp")