[CM] s7 loading functions

Woody Douglass wdouglass at carnegierobotics.com
Fri Jul 12 07:25:52 PDT 2019


Mr Schottstaedt,

Thanks for the advice, and for this great interpreter! using a lambda for autoloading native libraries works well, and I'm using the attached patch to search the load path for .so files; i've tested it a bit and it seems to work. The patch also adds the current directory "." as an implicit entry to the load path; this makes things a bit simpler, and it's easy to override in scheme if necessary.

Good luck and thanks again,
Woody Douglass



On 2019-07-11 17:40:43-04:00 bil at ccrma.Stanford.EDU wrote:

Now I read the code... the autoloader can't work
with just the *.so library name (as opposed to a function)
because it can't tell what
the init function's name is.  You could do this with
s7_load_with_environment if it were extended to handle
*.so files, because you can pass the init function
name in the environment argument, or you could call
the init function explicitly after loading, but autoload happens
at the point where an undefined name is encountered,
so you need to pass a function something like
(lambda (e) (load "libc.so" (inlet 'init_func 'init)))



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cm-mail.stanford.edu/mailman/private/cmdist/attachments/20190712/332cf71f/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: load-path-native.patch
Type: application/octet-stream
Size: 3651 bytes
Desc: load-path-native.patch
URL: <https://cm-mail.stanford.edu/mailman/private/cmdist/attachments/20190712/332cf71f/attachment.obj>


More information about the Cmdist mailing list