RE: More problems from ANSI tests

"Roger Corman" <[email protected]> Sat, 22 Mar 2003 19:13:52 -0800
Newsgroups gmane.lisp.corman
Message-ID <000001c2f0ea$3b199120$0300a8c0@roger>
Thanks for the report.
I have a fix for the first three items which will be in the next patch
set. If anybody needs it sooner let me know.

The (RETURN-FROM NIL) problem is trickier. It's not hard to change, I
just need to make sure it doesn't break any code.

Roger

-----Original Message-----
From: JP Massar [mailto:[email protected]] 
Sent: Thursday, March 20, 2003 3:55 PM
To: roger Corman
Cc: [email protected]
Subject: More problems from ANSI tests



;;; SETF DOES NOT OBEY LEFT-TO-RIGHT SEMANTICS

(defun setf-bug ()
   (let ((x (vector 1 2 3)))
     (setf (aref x (progn (print 'first) 0)) (progn (print 'second) 4))
     (aref x 0)))

;;; Corman:

(setf-bug)

SECOND
FIRST 4

;;; Allegro:

CG-USER(2): (setf-bug)

FIRST
SECOND
4

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;; CANNOT SETF INTO A MACROLET'ed MACRO

(defun macrolet-setf-bug ()
   (macrolet ((foo (y) `(car ,y)))
     (let ((x (list 1)))
       (values (setf (foo x) 2) (1+ (car x))))))

;;; An error occurred in function MACROEXPAND:
;;; Error: There is no SETF expansion method defined for (FOO X)

(defmacro bar (y) `(car ,y))
(defun defmacro-setf-ok ()
   (let ((x (list 1)))
     (values (setf (bar x) 2) (1+ (car x)))))


;;; PSETQ DOES NOT RETURN NIL WHEN GIVEN A SINGLE SYMBOL-VALUE PAIR.

(psetq x 1)
1

(psetq x 1 y 2)
nil


;;; RETURN-FROM NIL doesn't exit to BLOCK NIL

(block nil (block foo (return 'good)) 'bad)
BAD
(block nil (block foo (return-from nil 'good)) 'bad)
BAD
(block :nil (block foo (return-from :nil 'good)) 'bad)
GOOD



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get 128 Bit SSL Encryption!
http://us.click.yahoo.com/xaxhjB/hdqFAA/xGHJAA/SyjtlB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
[email protected]

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/