From dpkatz at gmail.com Tue Nov 11 04:17:27 2008 From: dpkatz at gmail.com (Daniel Katz) Date: Mon, 10 Nov 2008 23:17:27 -0500 Subject: [plexippus-xpath-devel] Problem compiling xpath Message-ID: <7087E193-54A1-4A19-9E4D-C3E914720D9C@gmail.com> Hi - I just downloaded plexippus-xpath (via clbuild) and tried to compile it with sbcl (I also tried ccl and got the same result) on a PPC Mac OS X 10.5 machine, and ran into trouble: [... lots of earlier stuff elided...] ; /Users/dkatz/dev/lisp/libs/clbuild/source/plexippus-xpath/lexer.fasl written ; compilation finished in 0:00:05 ; compiling file "/Users/dkatz/dev/lisp/libs/clbuild/source/plexippus- xpath/parser.lisp" (written 10 NOV 2008 10:31:28 PM): ; compiling (IN-PACKAGE :XPATH) ; compiling (DEFMACRO LAMBDA* ...) ; compiling (DEFUN MAKE-FUNCTION-NAME ...) ; compiling (YACC:DEFINE-PARSER *XPATH-PARSER* ...) ; file: /Users/dkatz/dev/lisp/libs/clbuild/source/plexippus-xpath/ parser.lisp ; in: YACC:DEFINE-PARSER *XPATH-PARSER* ; (YACC:DEFINE-PARSER XPATH::*XPATH-PARSER* (:START-SYMBOL XPATH::EXPR) ; (:TERMINALS ; (:LPAREN :RPAREN :LBRACKET :RBRACKET :TWO- DOTS :DOT :AT ; :COMMA :COLONS :COLON :VARIABLE :NCNAME ...)) ; (:MUFFLE-CONFLICTS (8 0)) (XPATH::EXPR XPATH::OR-EXPR) ; (XPATH::PRIMARY-EXPR ; (:VARIABLE ; (XPATH::LAMBDA* (XPATH::X) `(:VARIABLE ,XPATH::X))) ; (:LPAREN XPATH::EXPR :RPAREN ; (XPATH::LAMBDA* (NIL XPATH::VAR NIL) XPATH::VAR)) ; :LITERAL :NUMBER XPATH::FUNCTION-CALL) ; (XPATH::LOCATION-PATH XPATH::RELATIVE- LOCATION-PATH ; XPATH::ABSOLUTE-LOCATION-PATH) ; (XPATH::ABSOLUTE-LOCATION-PATH ; (:/ (XPATH::LAMBDA* (NIL) '(:PATH #))) ; (:/ XPATH::RELATIVE-LOCATION-PATH ; (XPATH::LAMBDA* (NIL XPATH::A) `(:PATH # ,@#))) ; XPATH::ABBREVIATED-ABSOLUTE-LOCATION-PATH) ; (XPATH::RELATIVE-LOCATION-PATH ; (STEP (XPATH::LAMBDA* (XPATH::A) `(:PATH ,XPATH::A))) ; (XPATH::RELATIVE-LOCATION-PATH :/ STEP ; (XPATH::LAMBDA* (XPATH::A NIL XPATH::B) ; `(:PATH ,@# ,XPATH::B))) ; XPATH::ABBREVIATED-RELATIVE-LOCATION-PATH) ; (STEP ; (XPATH::AXIS-SPECIFIER XPATH::NODE-TEST ; XPATH::PREDICATES ; (XPATH::LAMBDA* (XPATH::A XPATH::B XPATH::C) ; `(,# ,XPATH::B , at XPATH::C))) ; (XPATH::AXIS-SPECIFIER XPATH::NODE-TEST ; (XPATH::LAMBDA* (XPATH::A XPATH::B) `(,# ,XPATH::B))) ; (XPATH::NODE-TEST XPATH::PREDICATES ; (XPATH::LAMBDA* (XPATH::B XPATH::C) ; `(:CHILD ,XPATH::B , at XPATH::C))) ; (XPATH::NODE-TEST ; (XPATH::LAMBDA* (XPATH::B) `(:CHILD ,XPATH::B))) ; XPATH::ABBREVIATED-STEP) ; (XPATH::PREDICATES (XPATH::PREDICATE) ; (XPATH::PREDICATE XPATH::PREDICATES ; (XPATH::LAMBDA* (XPATH::A XPATH::B) ; (CONS XPATH::A XPATH::B)))) ; ...) ; ; caught ERROR: ; (during macroexpansion of (YACC:DEFINE-PARSER *XPATH-PARSER* ...)) ; The variable LAMBDA* is unbound. ; compiling (DEFUN PARSE-XPATH ...) ; compiling (DEFUN TEST-LEXER ...) ; compiling (DEFUN DRIBBLE-TESTS ...) ; /Users/dkatz/dev/lisp/libs/clbuild/source/plexippus-xpath/ parser.fasl written ; compilation finished in 0:00:01 WARNING: COMPILE-FILE warned while performing # on #. ; ; compilation unit aborted ; caught 1 fatal ERROR condition ; caught 1 ERROR condition ; printed 5 notes ; Evaluation aborted. I didn't see an obvious problem since it compiled the lambda* macro just before it hit the problem area (unless there was an issue with the eval-when clause that I'm not understanding), but clearly the compilers don't like something. Any suggestions on what the issue might be? Thanks. Dan From david at lichteblau.com Tue Nov 11 08:00:37 2008 From: david at lichteblau.com (David Lichteblau) Date: Tue, 11 Nov 2008 09:00:37 +0100 Subject: [plexippus-xpath-devel] Problem compiling xpath In-Reply-To: <7087E193-54A1-4A19-9E4D-C3E914720D9C@gmail.com> References: <7087E193-54A1-4A19-9E4D-C3E914720D9C@gmail.com> Message-ID: <20081111080037.GA3574@lanthan.ununoctium.lichteblau.com> Quoting Daniel Katz (dpkatz at gmail.com): > I just downloaded plexippus-xpath (via clbuild) and tried to compile > it with sbcl (I also tried ccl and got the same result) on a PPC Mac > OS X 10.5 machine, and ran into trouble: [...] > ; caught ERROR: > ; (during macroexpansion of (YACC:DEFINE-PARSER *XPATH-PARSER* ...)) > ; The variable LAMBDA* is unbound. [...] > I didn't see an obvious problem since it compiled the lambda* macro > just before it hit the problem area (unless there was an issue with > the eval-when clause that I'm not understanding), but clearly the > compilers don't like something. > > Any suggestions on what the issue might be? Thanks for the report. I can reproduce it, but I'm pretty sure we are using cl-yacc correctly here. Unfortunately, current cl-yacc from darcs doesn't work with Plexippus anymore. Apparently it doesn't recognize such functions in productions since this patch: Tue Mar 25 21:53:18 CET 2008 Willem Broekema * Add :precedence option to productions. As a workaround, you can use "darcs unpull" in cl-yacc to remove this patch, fixing Plexippus (type 'y' followed by 'd'). d. From metawilm at gmail.com Tue Nov 11 19:23:24 2008 From: metawilm at gmail.com (Willem Broekema) Date: Tue, 11 Nov 2008 20:23:24 +0100 Subject: [plexippus-xpath-devel] Problem compiling xpath In-Reply-To: <20081111080037.GA3574@lanthan.ununoctium.lichteblau.com> References: <7087E193-54A1-4A19-9E4D-C3E914720D9C@gmail.com> <20081111080037.GA3574@lanthan.ununoctium.lichteblau.com> Message-ID: On Tue, Nov 11, 2008 at 9:00 AM, David Lichteblau wrote: > Quoting Daniel Katz (dpkatz at gmail.com): >> ; caught ERROR: >> ; (during macroexpansion of (YACC:DEFINE-PARSER *XPATH-PARSER* ...)) >> ; The variable LAMBDA* is unbound. > Thanks for the report. I can reproduce it, but I'm pretty sure we are > using cl-yacc correctly here. > > Unfortunately, current cl-yacc from darcs doesn't work with Plexippus > anymore. Apparently it doesn't recognize such functions in productions > since this patch: > > Tue Mar 25 21:53:18 CET 2008 Willem Broekema > * Add :precedence option to productions. That change of mine has caused this problem, indeed. Sorry about that. I have just sent the following as proposed fix to Juliusz Chroboczek: Tue Nov 11 20:10:58 CET 2008 Willem Broekema * fix_parse_production_precedence diff -rN old-cl-yacc/yacc.lisp new-cl-yacc/yacc.lisp 1108,1109c1108,1110 < (list ;; (#'func :precedence pr) < (values (car l) (getf (cdr l) :precedence))) --- > (list (if (eq (second l) :precedence) ;; (#'func :precedence pr) > (values (car l) (third l)) > (values l nil))) That makes all plexippus-xpath tests pass on Allegro 8.1 (in ANSI mode), except for the first which gives: TEST FAILED: (XPATH:EVALUATE "count(//following::div) * 10 + count(//div|body/div)" (CXML:PARSE-ROD "
" XPATH::*DOM-BUILDER*)) is expected to be 11.0d0 but was 11 - Willem