[CM] s7 autoload bug

Christos Vagias chris.actondev at gmail.com
Sun Jul 12 18:21:12 PDT 2020


Hi,

It seems that I found a bug concerning the autoload.
The following test fails:
- autoloads for aod.lib1, aod.lib2, aod.extra.foo
- OK: loading aod.lib1 & aod.lib2
- FAIL: loading aod.extra.foo


TEST(s7_environments, autoloads_bug) {
    const char *autoloads[6] = {
        // each pair of entries is entity name + file name
        "aod.lib1", "aod/lib1.scm",
        "aod.lib2", "aod/lib2.scm",
        "aod.extra.foo", "aod/extra/foo.scm",
    };

    s7_scheme* sc1 = s7_init();
    s7_autoload_set_names(sc1, autoloads, 3);
    char* sexp = "(begin "
                 "(require aod.lib1)"
                 "(require aod.lib2)"
                 "1)";
    // ok that works
    ASSERT_EQ(1, s7_integer(s7_eval_c_string(sc1, sexp)));

    s7_scheme* sc2 = s7_init();
    s7_autoload_set_names(sc2, autoloads, 3);
    char* sexp2 = "(begin "
                  "(require aod.extra.foo)"
                  "2)";
    // THAT FAILS!!
    ASSERT_EQ(2, s7_integer(s7_eval_c_string(sc2, sexp2)));
    /**
     * ----------
    ;require: no autoload info for aod.extra.foo
    ; (require aod.extra.foo)
    ; ((lambda (hook lst) (if (do ((p lst (cdr ...
    ; (2)
    * -----------
    */
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cm-mail.stanford.edu/mailman/private/cmdist/attachments/20200713/3aa6c053/attachment.html>


More information about the Cmdist mailing list