[gambit-list] Conformance to the R5RS

Marc Feeley feeley at iro.umontreal.ca
Mon Jun 17 12:41:28 EDT 2013

Thanks for the bug report.  I have known about this particular inconsistency (call/cc in letrec bindings) with the R5RS since the early 90's.  In those 20 years this is the first report of this inconsistency by a user.  Congratulations!

Given that no one has complained about it in the past I don't know if it is worth fixing, as this would require a complex analysis to handle internal definitions correctly and efficiently.  Personally I view it as a bug in the way letrec is defined in the R5RS (it is defined using mutable variables).

I'd like to know what other people think on this issue.  Note that it only affects compiled programs.  The analysis I'm thinking of is conservative, so some programs with internal definitions will run slower than before.

As for the second issue (failure 8.3) it is due to Gambit's use of the portable syntax-case macro expander.  As the comments say, many think that the R5RS spec has a bug:

;; This example actually illustrates a bug in R5RS.  If a Scheme system
;; follows the letter of the standard, 1 should be returned, but
;; the general agreement is that 2 should instead be returned.


On 2013-06-17, at 5:06 AM, egarrulo <egarrulo at gmail.com> wrote:

> Hello everyone,
> I'm a newcomer to Scheme and I was playing Gambit.
> While fiddling around, I have stumbled upon a Scheme file whose goal
> is to test an implementation's conformance to the R5RS:
> http://sisc-scheme.org/r5rs_pitfall.scm
> The Gambit interpreter passed all tests but the 8.3 (which could be a
> feature: read the file for explanations) and saving for a warning,
> whilst the Gambit compiler failed two more tests. Here is the
> session:
> $ cat ~/.gambcini
> (load "~~/lib/syntax-case")
> $ gsi r5rs_pitfall.scm
> ...
> Failure: 8.3, expected '1', got '2'.
> Map is call/cc safe, but probably not tail recursive or inefficient.
> $ gsc -exe r5rs_pitfall.scm
> $ ./r5rs_pitfall
> Failure: 1.1, expected '0', got '1'.
> ...
> Failure: 1.3, expected '#t', got '#f'.
> ...
> Failure: 8.3, expected '1', got '2'.
> Map is call/cc safe, but probably not tail recursive or inefficient.
> $ gsc -v
> v4.6.8 20130430024640 i686-pc-linux-gnu "./configure
> '--enable-single-host' '--enable-c-opt' '--enable-multiple-versions'
> '--prefix=/home/egarrulo/bin/gambit/gambit-4.6.8'"
> $ gcc -v
> Using built-in specs.
> Target: i486-linux-gnu
> Configured with: ../src/configure -v --with-pkgversion='Debian 4.4.5-8'
> --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs
> --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr
> --program-suffix=-4.4 --enable-shared --enable-multiarch
> --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib
> --without-included-gettext --enable-threads=posix
> --with-gxx-include-dir=/usr/include/c++/4.4 --libdir=/usr/lib
> --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug
> --enable-objc-gc --enable-targets=all --with-arch-32=i586
> --with-tune=generic --enable-checking=release --build=i486-linux-gnu
> --host=i486-linux-gnu --target=i486-linux-gnu
> Thread model: posix
> gcc version 4.4.5 (Debian 4.4.5-8)
> $ cat /etc/debian_version
> 6.0.7
> Any comments? Thanks for your attention.
> _______________________________________________
> Gambit-list mailing list
> Gambit-list at iro.umontreal.ca
> https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list

More information about the Gambit-list mailing list