From: Kevin M. Rosenberg Date: Sat, 3 May 2003 20:18:40 +0000 (+0000) Subject: r4761: Auto commit for Debian build X-Git-Tag: v2006ac.2~237 X-Git-Url: http://git.kpe.io/?a=commitdiff_plain;h=4998fa5c059c366d6ed4d87533082c78a6ffb42c;p=umlisp.git r4761: Auto commit for Debian build --- diff --git a/sql-classes.lisp b/sql-classes.lisp index 331bb53..9f8c6b1 100644 --- a/sql-classes.lisp +++ b/sql-classes.lisp @@ -7,7 +7,7 @@ ;;;; Author: Kevin M. Rosenberg ;;;; Date Started: Apr 2000 ;;;; -;;;; $Id: sql-classes.lisp,v 1.34 2003/05/03 20:12:08 kevin Exp $ +;;;; $Id: sql-classes.lisp,v 1.35 2003/05/03 20:18:40 kevin Exp $ ;;;; ;;;; This file, part of UMLisp, is ;;;; Copyright (c) 2000-2002 by Kevin M. Rosenberg, M.D. @@ -31,20 +31,23 @@ &key (lrlname "KCUILRL") distinct single order like) &body body) - (let ((query (gensym))) + (if single `(unless (and ,where-name (not ,where-value)) - (let ((,query (umlisp-query ,table ,fields ,srl ,where-name ,where-value - :lrlname ,lrlname :single ,single :distinct ,distinct - :order ,order :like ,like))) - (if ,single - (let ((tuple (car ,query))) - (when tuple - (destructuring-bind ,fields tuple - ,@body))) - (loop - for tuple in ,query collect - (destructuring-bind ,fields tuple - ,@body))))))) + (let ((tuple (car (umlisp-query ,table ,fields ,srl ,where-name ,where-value + :lrlname ,lrlname :single ,single + :distinct ,distinct :order ,order :like ,like)))) + (when tuple + (destructuring-bind ,fields tuple + ,@body)))) + `(unless (and ,where-name (not ,where-value)) + (let ((tuple (car ))) + (loop for tuple in + (umlisp-query ,table ,fields ,srl ,where-name ,where-value + :lrlname ,lrlname :single ,single + :distinct ,distinct :order ,order :like ,like) + collect + (destructuring-bind ,fields tuple + ,@body)))))) (defmacro umlisp-query (table fields srl where-name where-value &key (lrlname "KCUILRL") single distinct order like)