<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/4.2.2">
</HEAD>
<BODY>
Marc:<BR>
<BR>
Since you're moving the primitive expansion code to _t-univ.scm, this is a good time to fix the expansions of map and foreach.<BR>
<BR>
For example, consider the following source code:<BR>
<BR>
<PRE>
(declare (standard-bindings)
(extended-bindings)
(block))
(define (my-car x)
(car x))
(define (map-car l)
(map car l))
(define (map-my-car l)
(map my-car l))
(define l '((1 2) . 4))
(pp l)
(pp 'map-car)
(pp (map-car l))
(pp 'map-my-car)
(pp (map-my-car l))
</PRE>
<BR>
I'm not going to show the output of<BR>
<BR>
heine:~/Desktop> gsc -c -expansion test-map.scm<BR>
<BR>
but you get the following behavior in the interpreter and the compiler:<BR>
<BR>
<PRE>
heine:~/Desktop> gsc test-map.scm
heine:~/Desktop> gsi test-map.scm
((1 2) . 4)
map-car
*** ERROR IN "test-map.scm"@20.5 -- (Argument 2) LIST expected
(map '#<procedure #2 car> '((1 2) . 4))
heine:~/Desktop> gsi test-map
((1 2) . 4)
map-car
(1)
map-my-car
*** ERROR IN | test-map.o3| -- (Argument 2) LIST expected
(map '#<procedure #2 my-car> '((1 2) . 4))
</PRE>
And, if you look at the generated C code, map-car unconditionally calls generic car, while map-my-car optimistically expands the call to car.<BR>
<BR>
In brief, map-car doesn't catch the error, and it's a lot slower than map-my-car. In my opinion, map-car and map-my-car should have the same code.<BR>
<BR>
Brad
</BODY>
</HTML>