- (if single
- `(unless (and ,where-name (not ,where-value))
- (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))
- (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)))))
+ (let ((value (gensym)))
+ (if single
+ `(let ((,value ,where-value))
+ (when ,value
+ (let ((tuple (car (umlisp-query ,table ,fields ,srl ,where-name ,value
+ :lrl ,lrl :single ,single
+ :distinct ,distinct :order ,order
+ :like ,like))))
+ (when tuple
+ (destructuring-bind ,fields tuple
+ ,@body)))))
+ `(let ((,value ,where-value))
+ (when ,value
+ (loop for tuple in
+ (umlisp-query ,table ,fields ,srl ,where-name ,value
+ :lrl ,lrl :single ,single :distinct ,distinct
+ :order ,order :like ,like)
+ collect (destructuring-bind ,fields tuple
+ ,@body)))))))