Follow-up Comment #1, bug #30070 (project guile):
Using srfi-1 and vanilla guile gives the same erroneous behavior.
I couldn't locate the vanilla map definition in the source code but looking at
srfi-1 revealed the problem.
Basically the map is a tail loop where the reversed list is built.
Then a reverse! is done to correct the list order. This is the root
of the problem. Just replacing reverse! with reverse fixes this bug but
introduces a slight performance issue of the order of say 20%. and a double of
amount of consing done in the algorithm.
It's possible to rewrite map using a tail pointer to get the correct behavior
without penalties.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?30070>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/