Unexpected results from prolog code

Damien Kick <[email protected]> Sat, 30 Jun 2007 22:37:43 +0000 (UTC)
Newsgroups gmane.lisp.allegro
Message-ID <[email protected]>
USER> (?- (lisp ?terms (rewrite-dcg-term (car *x*)))
          (= ?terms ((move ?list/1 ?rest) (step ?list/1 ?rest))))
?TERMS = ((MOVE ?LIST/633 ?REST/632) (STEP ?LIST/633 ?REST/632))
?LIST/1 = ?LIST/633
?REST = ?REST/632

No.
; No value
USER> (multiple-value-bind (x error)
          (ignore-errors
            (prolog
              (lisp ?terms (rewrite-dcg-term (car *x*)))
              (= ?terms ((move ?list/1 ?rest) (step ?list/1 ?rest)))
              (lisp (return-from prolog t))))
        (declare (ignore x))
        (format *error-output* "~A" error))
attempt to call `PROLOG::DE-LIST' which is an undefined function.
NIL
USER> (compile nil
               (lambda ()
                 (prolog
                   (lisp ?terms (rewrite-dcg-term (car *x*)))
                   (= ?terms ((move ?list/1 ?rest) (step ?list/1 ?rest)))
                   (lisp (return-from prolog t)))))
#<Function (:ANONYMOUS-LAMBDA 35) @ #x10daef12>
NIL
NIL
USER> (funcall *)
T
USER> (lisp-implementation-type)
"International Allegro CL Professional Edition"
USER> (lisp-implementation-version)
"8.0 [Mac OS X] (Jun 16, 2007 0:07)"
USER> 

I would have expected the middle example to not have returned an error.