Fix comment
[jscl.git] / src / ffi.lisp
1 ;;; ffi.lisp ---
2
3 ;; JSCL is free software: you can redistribute it and/or
4 ;; modify it under the terms of the GNU General Public License as
5 ;; published by the Free Software Foundation, either version 3 of the
6 ;; License, or (at your option) any later version.
7 ;;
8 ;; JSCL is distributed in the hope that it will be useful, but
9 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
10 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 ;; General Public License for more details.
12 ;;
13 ;; You should have received a copy of the GNU General Public License
14 ;; along with JSCL.  If not, see <http://www.gnu.org/licenses/>.
15
16 (/debug "loading ffi.lisp!")
17
18 (define-setf-expander oget (object key &rest keys)
19   (let* ((keys (cons key keys))
20          (g!object (gensym))
21          (g!keys (mapcar (lambda (s)
22                            (declare (ignore s))
23                            (gensym))
24                          keys))
25          (g!value (gensym)))
26     (values `(,g!object ,@g!keys)
27             `(,object ,@keys)
28             `(,g!value)
29             `(oset ,g!value ,g!object ,@g!keys)
30             `(oget ,g!object ,@g!keys))))
31
32 (define-setf-expander oget* (object key &rest keys)
33   (let* ((keys (cons key keys))
34          (g!object (gensym))
35          (g!keys (mapcar (lambda (s)
36                            (declare (ignore s))
37                            (gensym))
38                          keys))
39          (g!value (gensym)))
40     (values `(,g!object ,@g!keys)
41             `(,object ,@keys)
42             `(,g!value)
43             `(oset* ,g!value ,g!object ,@g!keys)
44             `(oget* ,g!object ,@g!keys))))
45
46
47