/[slime]/slime/swank-backend.lisp
ViewVC logotype

Diff of /slime/swank-backend.lisp

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

revision 1.45 by lgorrie, Sun May 2 02:16:04 2004 UTC revision 1.46 by heller, Tue May 4 18:57:52 2004 UTC
# Line 79  The portable code calls this function at Line 79  The portable code calls this function at
79          (sort (copy-list *unimplemented-interfaces*) #'string<)))          (sort (copy-list *unimplemented-interfaces*) #'string<)))
80    
81    
82    ;;;; Utilities
83    
84    (defmacro with-struct ((conc-name &rest names) obj &body body)
85      "Like with-slots but works only for structs."
86      (flet ((reader (slot) (intern (concatenate 'string
87                                                 (symbol-name conc-name)
88                                                 (symbol-name slot))
89                                    (symbol-package conc-name))))
90        (let ((tmp (gensym "OO-")))
91        ` (let ((,tmp ,obj))
92            (symbol-macrolet
93                ,(loop for name in names collect
94                       (typecase name
95                         (symbol `(,name (,(reader name) ,tmp)))
96                         (cons `(,(first name) (,(reader (second name)) ,tmp)))
97                         (t (error "Malformed syntax in WITH-STRUCT: ~A" name))))
98              ,@body)))))
99    
100  ;;;; TCP server  ;;;; TCP server
101    
102  (definterface create-socket (host port)  (definterface create-socket (host port)

Legend:
Removed from v.1.45  
changed lines
  Added in v.1.46

  ViewVC Help
Powered by ViewVC 1.1.5