Re: s48_extract_string?

Donald Allen <[email protected]>
Newsgroups gmane.lisp.scheme.scheme48
Message-ID <[email protected]>
Thanks for clearing this up.

What is the status of the Scheme48 project? Is it being actively
maintained or has everyone moved on?  Such an old (3 minor version)
error in the documentation makes me wonder even more.

I prefer working in Scheme to anything else and Scheme48 looks very
nice (knowing Jonathan, I'd be surprised if it were otherwise) and, as
I said, the ability to call C functions is crucial for what I have in
mind. But I don't want to commit a lot of effort to using it if it's
essentially unsupported.

Thanks again for your help.

/Don

On Sat, Feb 28, 2009 at 9:12 AM, Taylor R Campbell <[email protected]> wrote:
>   Date: Sat, 28 Feb 2009 13:46:47 +0100
>   From: Donald Allen <[email protected]>
>
>   I get
>
>   > (load-dynamic-externals "/home/dca/Scheme48/test.so" #f #f #f)
>
>   Error: vm-exception
>          os-error
>          (call-external-value "shared_object_dlopen"
>   "/home/dca/Scheme48/test.so: undefined symbol: s48_extract_string")
>
>   If I substitute a call in the C code to, say, s48_extract_byte_vector,
>   then load-dynamic-externals is happy.
>
> The documentation appears to be outdated.  Since Scheme48 1.5 or so,
> when R6RSoid support for Unicode was introduced, s48_extract_string
> has been no more.  Instead you must use `OS strings' on the Scheme
> side and translate them to byte vectors for C use.  The relevant `OS
> string' procedures are provided by the OS-STRINGS structure For
> instance, here is how Scheme48's POSIX library currently wraps
> getenv(3):
>
> ;;; scheme/proc/posix-env.scm
>
> (define (lookup-environment-variable name)
>  (cond
>   ((external-lookup-environment-variable
>     (os-string->byte-vector
>      (x->os-string name)))
>    => x->os-string)
>   (else #f)))
>
> (import-lambda-definition external-lookup-environment-variable (name)
>  "posix_get_env")
>
> ;;; c/posix/proc-env.c
>
> static s48_value
> posix_get_env(s48_value name)
> {
>  char *value;
>
>  value = getenv(s48_extract_byte_vector(name));
>
>  return (value == NULL) ? S48_FALSE : s48_enter_byte_string(value);
> }
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.