From: SourceForge.net <no...@so...> - 2007-06-06 16:04:17
|
Bugs item #1731462, was opened at 2007-06-05 16:59 Message generated for change (Comment added) made by hoehle You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=1731462&group_id=1355 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: clisp Group: lisp error >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Jörg Höhle (hoehle) >Assigned to: Jörg Höhle (hoehle) Summary: bogus expansion when using EXT:LETF with more than one place Initial Comment: Hi, Looking at CLISP macroexpansions after my (gensym "NAME-") patches made me uncover 2 bugs. Here is one. (ext:letf (((car x) 1)) (princ x)) ; ok (ext:letf (((car x) 1) ((cdr x) 2)) (princ x)) ; bogus (LETF* ((#:TEMP-3605 X) (#:NEW-3604 (CAR #:TEMP-3605)) (#:G3606 1)) (UNWIND-PROTECT (PROGN (SYSTEM::%RPLACA #:TEMP-3605 #:G3606) (SYSTEM::%RPLACD #:TEMP-3602 #:G3603) (PRINC X)) (SYSTEM::%RPLACA #:TEMP-3605 #:NEW-3604) (SYSTEM::%RPLACD #:TEMP-3602 #:NEW-3601))) ext:letf* seems not affected. (ext:letf (((car x) 1) ((ldb (byte 6 8) (aref y 2)) 3)) (princ x)) "3" is not found in expansion #:6281 (new value) is never bound (LETF* ((#:TEMP-6283 X) (#:NEW-6282 (CAR #:TEMP-6283)) (#:G6284 1)) (UNWIND-PROTECT (PROGN (SYSTEM::%RPLACA #:TEMP-6283 #:G6284) (LET ((#:G6278 (DPB #:G6281 #:BYTESPEC-6279 (AREF #:G6276 #:G6277)))) (SYSTEM::STORE #:G6276 #:G6277 #:G6278) #:G6281) (PRINC X)) (SYSTEM::%RPLACA #:TEMP-6283 #:NEW-6282) (LET ((#:G6278 (DPB #:NEW-6280 #:BYTESPEC-6279 (AREF #:G6276 #:G6277)))) (SYSTEM::STORE #:G6276 #:G6277 #:G6278) #:NEW-6280))) A single (ext:letf (#) ...) is not affected (ext:letf (((ldb (byte 6 8) (aref y 2)) 3)) (princ x)) - but possibly not optimal (or correct?) Same for (setf (char-bit (aref y 2) :control) t) ; ok (ext:letf (((char-bit (aref y 2) :control) t)) (princ x)) ; weird? -- why is aref called 3 times? 1 could be enough. (LETF* ((#:G6325 Y) (#:G6326 2) (#:G6328 :CONTROL) (#:G6329 (CHAR-BIT (AREF #:G6325 #:G6326) #:G6328)) (#:G6330 T)) (UNWIND-PROTECT (PROGN (LET ((#:G6327 (SET-CHAR-BIT (AREF #:G6325 #:G6326) #:G6328 #:G6330))) (SYSTEM::STORE #:G6325 #:G6326 #:G6327) #:G6330) (PRINC X)) (LET ((#:G6327 (SET-CHAR-BIT (AREF #:G6325 #:G6326) #:G6328 #:G6329))) (SYSTEM::STORE #:G6325 #:G6326 #:G6327) #:G6329))) There's not a single test for EXT:EXTF in the whole testsuite! What would be a good file to add them (create a new file?) ---------------------------------------------------------------------- Comment By: Jörg Höhle (hoehle) Date: 2007-06-06 16:23 Message: Logged In: YES user_id=377168 Originator: YES thank you for your bug report. the bug has been fixed in the CVS tree. you can either wait for the next release (recommended) or check out the current CVS tree (see http://clisp.cons.org) and build CLISP from the sources (be advised that between releases the CVS tree is very unstable and may not even build on your platform). ---------------------------------------------------------------------- Comment By: Sam Steingold (sds) Date: 2007-06-05 17:02 Message: Logged In: YES user_id=5735 Originator: NO new file is best because this is a clisp extension ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=1731462&group_id=1355 |