;;;; Programmers: Kevin M. Rosenberg and John DeSoi
;;;; Date Started: Feb 2002
;;;;
-;;;; $Id: strings.cl,v 1.2 2002/09/20 04:51:14 kevin Exp $
+;;;; $Id: strings.cl,v 1.3 2002/09/29 18:54:17 kevin Exp $
;;;;
;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;; and John DeSoi
,@body)))
-#| Works but, supposedly the built in method is better
-(defmacro with-cstring ((foreign-string lisp-string) &body body)
- (let ((result (gensym)))
- `(let* ((,foreign-string (convert-to-cstring ,lisp-string))
- (,result ,@body))
- (dispose-ptr ,foreign-string)
- ,result))
- )
-
-|#
-
-
-
+(defmacro with-cstrings (bindings &rest body)
+ (if bindings
+ `(with-cstring ,(car bindings)
+ (with-cstrings ,(cdr bindings)
+ ,@body))
+ `(progn ,@body)))
(defmacro with-foreign-string ((foreign-string lisp-string) &body body)
(let ((result (gensym)))