ecraven / r7rs-benchmarks

Benchmarks for various Scheme implementations. Taken with kind permission from the Larceny project, based on the Gabriel and Gambit benchmarks.
274 stars 32 forks source link

Change Chez and Petite preludes to add support for all benchmarks. #12

Closed michaellenaghan closed 8 years ago

michaellenaghan commented 8 years ago

Chez (and Petite) were failing many benchmarks because imported identifiers were being redefined. That's not allowed in R6RS; see 7.1:

An identifier can be imported with the same local name from two or more libraries or for two levels from the same library only if the binding exported by each library is the same (i.e., the binding is defined in one library, and it arrives through the imports only by exporting and re-exporting). Otherwise, no identifier can be imported multiple times, defined multiple times, or both defined and imported. No identifiers are visible within a library except for those explicitly imported into the library or defined within the library.

R7RS has the same restriction; see 5.2:

In a program or library declaration, it is an error to import the same identifier more than once with different bindings, or to redefine or mutate an imported binding with a definition or with set!, or to refer to an identifier before it is imported.

I initially changed the benchmarks to use local names. That would have helped any R6RS-based Scheme—but I ended up thinking that was too big a change, and took this more conservative approach instead. See what you think.

ecraven commented 8 years ago

Thank you very much for this, this is great!