ashinn / chibi-scheme

Official chibi-scheme repository
Other
1.22k stars 141 forks source link

include-shared with flat layout? #874

Closed husnoo closed 1 year ago

husnoo commented 1 year ago

Hi,

On Android, in srfi/69.sld, I tried to replace (include-shared "hash") with (load "libhash.so"), and it caused some problems:

    WARNING: reference to undefined variable: hash-table-cell
    WARNING: reference to undefined variable: hash
    WARNING: reference to undefined variable: hash-by-identity
    WARNING: importing undefined variable: hash-table-delete!

But when I do (include-shared "libhash"), it tries to look for "srfi/libhash.so".

Where do I need to hack away to remove the directory paths? I just have libhash.so living in a flat lib/ directory (and I can't figure out how to get CMake on android to move it to lib/srfi/).

ashinn commented 1 year ago

load uses the interaction-environment, not the enclosing module environment.

You would need something like:

(begin (load "libhash.so" (current-environment)))

but this doesn't work.