Closed justinethier closed 5 years ago
Hi Justin,
The SRFI-1 library uses the reference implementation Shivers originally provided. This version might indeed not be optimal for Bigloo. When an equivalent native Bigloo function exists, I strongly recommend to use that version because it is very likely to be more efficient (because for instance, the compiler overrides many of these functions with faster macros).
However, they is not reason to leave that problem in SRFI-1 now we know it exists. I have then replaced the problematic implementation with the BIgloo native one.
Thanks for your report.
No problem. Thanks @manuel-serrano !
The following program segfaults at runtime when using the SRFI 1 version of
filter-map
:However, it works fine when the SRFI 1 library is commented-out, so the built-in version of
filter-map
is fine. It seems the version in SRFI 1 is not written in a way that can be safely tail-call optimized by Bigloo. Here is the stack trace from gdb. Note that when running into this in an actual program the stack trace was an order of magnitude smaller, so a much shorter list (~10000 elements) caused the crash:Since the built-in
filter-map
can handle multiple list arguments, is there any reason to include the SRFI 1 version at all? Perhaps it should be removed like some of the other functions in that module.There are probably other SRFI 1 functions affected as well.