[iterate-devel] more bug-fixes available
Hoehle, Joerg-Cyril
Joerg-Cyril.Hoehle at t-systems.com
Tue Feb 1 17:21:48 UTC 2005
Hi,
I have fixed some more bugs or problem areas in my copy of iterate, and I can send that to anybody who wishes.
You may want to try the following test in your original version:
(deftest or.1
(iter (generate x in '(a nil nil 1))
(generate y in-vector '#(2 #\c #\d))
(collect (or (next x) (next y))))
(a 2 #\c 1))
>From my changes file:
o (if (next x) ...) works -- the test form is walked too
+ allow better compiler optimizations by keeping macros like
and, or, prog1 etc. in the expanded code.
The expansion also becomes more readable (closer to the source).
+ #+clisp support ((setf foo) new-value args...) function syntax
+ #+clisp simple support for handler-bind (not walking handlers)
+ free-vars correctly handles locally, symbol-macrolet and declare
+ use macroexpand-1 only to ensure all special handlers get used
and still more test cases
Marco, I don't know how you modified your UCW and CPS converter for use with CLISP, but I recommend you do not use sys::setf-... (clisp internals) -- I'm not even sure your patch works in all conceivable cases.
I don't know what the requirements for ucw/cps are, but here's what I use for iterate:
#+clisp ; some macros expand into ((setf foo) value other-args...)
;; reported by Marco Baringer on 24 Jan 2005
((typep form '(cons (cons (eql setf) *) *))
(apply #'walk-cdr form))
You can see that the setf form is treated like any other function call, and there's no need to make use of (possibly changing) internals.
Things I changed previously are:
o (DSETQ (values x nil y)) works
o restore v 1.0/2 special/macro order, e.g. change special-form? etc.
o in-vector/in-sequence downwards by 2 did not start with last element
(iter (for i index-of-vector #(0 1 2 3 4) downto 0 by 2) (collect i))
yielded (3 1), expect (4 2 0) by similarity with
(iter (for i downfrom 4 by 2) (collect i)) and
(iter (for i from 4 downto 0 by 2) (collect i))
+ locally accepts [0..N] declarations
+ constant? and self-evaluating? accept all self-evaluating forms, including
keywords and T/NIL, but no other symbols.
+ avoid ~< pretty-printer (not in Cormanlisp) in error messages, leave that to
the implementation
+ if-1st-time & special-clause ELSE: type 'boolean instead of symbol
+ #+clisp "explicit declarations are always placed in the generated code" as
the manual says.
+ #+lispworks multiple-value-bind is recognized (again)
+ make-next-code N <> 1 generates correct code
Regards,
Jorg Hohle
More information about the iterate-devel
mailing list