scsh-users
[Top] [All Lists]

Is s48_extract_double actually useful?

To: scsh-news@zurich.ai.mit.edu
Subject: Is s48_extract_double actually useful?
From: Felix Klock <felix_klock_ii@mac.com>
Date: Sun, 15 Dec 2002 18:33:45 GMT
Organization: Cox Communications
Scsh users-

With scheme48 0.57, I'm trying to pass an inexact value into C code.

However, whenever I call s48_extract_double on an s48_value (like 1.5 or 
(exact->inexact 1)), I get a message like:

Error: exception
        wrong-type-argument
        (call-external-value "scmDoubleDouble" 1.5)


After further investigation, I found that the STOB_TYPE for the 
s48_value being passed along was S48_STOBTYPE_EXTENDED_NUMBER (11),
but the code in the double conversion routine will only take 
S48_STOBTYPE_DOUBLE's (19)

Furthermore, on first glance it seems like there is no way to generate 
S48_STOBTYPE_DOUBLE's other than calling something like
"inexact = s48_enter_double();" from C code, but then once I pass 
'inexact' back to the Scheme interpreter, none of the standard 
procedures (like 'display') can handle it.

Has anyone else run into this problem?  I'm going to go ahead and hack 
up the source in the meantime to try to work around this (I'll probably 
attempt to figure out how to convert an extended-number into a double 
from within the code for s48_extract_double) but I'd like to know if 
there's better way someone else has already come up with.

-Felix

p.s. do people find this list a better place to pose scheme48 specific 
questions (as opposed to comp.lang.scheme)?  Or would it be better for 
me to be asking there instead?  I know this is really supposed to be a 
newsgroup about scsh (and I am a happy user of scsh!) but I figured 
since scsh is a layer on top of scheme48, some people were probably 
well-versed with both systems....


<Prev in Thread] Current Thread [Next in Thread>