Call a function in a shared library: Difference between revisions

added Ol
(Rename Perl 6 -> Raku, alphabetize, minor clean-up)
(added Ol)
Line 1,362:
dlclose xlib;
;;</lang>
 
=={{header|Ol}}==
Note: "strdup" is existent shared function, "strduX" is not existent.
<lang scheme>
(import (otus ffi))
 
(define self (load-dynamic-library #f))
(define strdup (or
(self type-string "strdup" type-string)
(lambda (str)
(list->string (string->list str)))))
 
(define strduX (or
(self type-string "strduX" type-string)
(lambda (str)
(list->string (string->list str)))))
 
(print (strdup "Hello World!"))
(print (strduX "Hello World!"))
</lang>
{{Out}}
<pre>
Hello World!
Hello World!
</pre>
 
=={{header|OxygenBasic}}==