(cond
;; Object query resulting in a list of returned object instances
- #+ignore
- ((and (consp (first in-phrase))
- (consp (second (first in-phrase)))
- (eq 'quote (first (second (first in-phrase))))
- (symbolp (second (second (first in-phrase)))))
+ ((and (consp (first in-phrase))
+ (consp (second (first in-phrase)))
+ (eq 'quote (first (second (first in-phrase))))
+ (symbolp (second (second (first in-phrase)))))
(let ((result-var (ansi-loop::loop-gentemp
'loop-record-result-))
(,step-var nil))
()
()
+ ()
(if (null ,result-var)
t
(progn
(cond
;; Object query resulting in a list of returned object instances
- ((and (consp (car in-phrase))
- (consp (second (car in-phrase)))
- (eq 'quote (first (second (car in-phrase))))
- (symbolp (second (second (car in-phrase)))))
- (loop-error "object query not yet supported"))
+ ((and (string-equal "select" (symbol-name (car in-phrase)))
+ (eq 'quote (first (second in-phrase)))
+ (symbolp (second (second in-phrase))))
+
+ (let ((result-var (gensym "LOOP-RECORD-RESULT-"))
+ (step-var (gensym "LOOP-RECORD-STEP-")))
+ (values
+ t
+ nil
+ `(,@(mapcar (lambda (v) `(,v nil)) iter-var)
+ (,result-var ,in-phrase)
+ (,step-var nil))
+ ()
+ ()
+ ()
+ `((if (null ,result-var)
+ t
+ (progn
+ (setq ,step-var (first ,result-var))
+ (setq ,result-var (rest ,result-var))
+ nil)))
+ `(,iter-var ,step-var)
+ `((if (null ,result-var)
+ t
+ (progn
+ (setq ,step-var (first ,result-var))
+ (setq ,result-var (rest ,result-var))
+ nil)))
+ `(,iter-var ,step-var)
+ ()
+ ()
+ )))
((consp iter-var)
(let ((query-var (gensym "LOOP-RECORD-"))