/[cffi-objects]/setters.lisp
ViewVC logotype

Diff of /setters.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1 by rklochkov, Thu Feb 9 15:53:55 2012 UTC revision 7 by rklochkov, Thu Aug 9 16:55:23 2012 UTC
# Line 31  Line 31 
31                         (field-p (if (consp field-all)                         (field-p (if (consp field-all)
32                                      (third field-all) field-all)))                                      (third field-all) field-all)))
33                     `(when ,field-p                     `(when ,field-p
34                        (setf (,field ,object) ,field))))                        (unless (initialized ,object ,field)
35                            (setf (,field ,object) ,field)
36                            (initialize ,object ,field)))))
37                 fields)))                 fields)))
38    
39    (defun initialized (obj field)
40      (find field (slot-value obj 'initialized)))
41    
42    (defun initialize (obj fields)
43      "Used when you need to mark, that FIELDS already initialized"
44      (etypecase fields
45        (list (dolist (field fields)
46                (initialize obj field)))
47        (symbol (push fields (slot-value obj 'initialized)))))
48    
49  (defun name-p (name)  (defun name-p (name)
50    (intern (format nil "~a-P" name) (symbol-package name)))    (intern (format nil "~a-P" name) (symbol-package name)))
51    

Legend:
Removed from v.1  
changed lines
  Added in v.7

  ViewVC Help
Powered by ViewVC 1.1.5