1 Aug 1994 20:55
1 Aug 1994 21:33
3 Aug 1994 22:59
Externals problems in Scheme 48 0.36
<jamies <at> fireant.ma.utexas.edu>
1994-08-03 20:59:20 GMT
1994-08-03 20:59:20 GMT
I tried to duplicate the test.so example of external.scm, but things didn't work so great. The documentation doc/external.txt seems to be out of date (if you disagree, let me know), so I don't really know what I'm doing. Is there current documentation? See below for the results of my test. If you want the gory details, I'll send then to you. Thanks for the promising implementation. --Jamie Stephens, jamies <at> math.utexas.edu Welcome to Scheme 48 0.36 (made by jamies on Thu Jun 9 11:00:30 CDT 1994). Copyright (c) 1993, 1994 by Richard Kelsey and Jonathan Rees. Please report bugs to scheme-48-bugs <at> martigny.ai.mit.edu. Type ,? (comma question-mark) for help. > ,open externals Load structure externals (y/n)? y [externals /d2/grad/jamies/Scheme/Lib/scheme48/big/external.scm ............. ] > (define dynamic-load (get-external "dynload.o")) > (external-call dynamic-load (null-terminate "external-test.so")) Segmentation fault (core dumped)
4 Aug 1994 00:03
Re: Externals problems in Scheme 48 0.36
<kelsey <at> research.nj.nec.com>
1994-08-03 22:03:22 GMT
1994-08-03 22:03:22 GMT
Date: Wed, 3 Aug 94 15:59:20 -0500
From: jamies <at> fireant.ma.utexas.edu
Posted-Date: Wed, 3 Aug 94 15:59:20 -0500
I tried to duplicate the test.so example of external.scm, but things
didn't work so great. The documentation doc/external.txt seems to be
out of date (if you disagree, let me know), so I don't really know
what I'm doing. Is there current documentation?
doc/external.txt is not quite up to date, but what it says to do
should still work. One out-of-date bit is that by version 0.36 all
Scheme 48 strings are null-terminated, so that part can be ignored.
[stuff elided]
> ,open externals
Load structure externals (y/n)? y
[externals
/d2/grad/jamies/Scheme/Lib/scheme48/big/external.scm .............
]
> (define dynamic-load (get-external "dynload.o"))
^^^^^^^^^
In the documentation this is "s48_dynamic_load". dynload.o is not
a C procedure, so calling it with EXTERNAL_CALL is unlikely to work.
What I don't understand is why you didn't get a message like
Warning: External not found
"dynload.o"
(Continue reading)
5 Aug 1994 10:06
5 Aug 1994 19:32
Externals problems in Scheme 48 0.36
Jonathan Rees <jar <at> martigny.ai.mit.edu>
1994-08-05 17:32:12 GMT
1994-08-05 17:32:12 GMT
Date: Wed, 3 Aug 94 18:03:22 -0400
From: kelsey <at> research.nj.nec.com
What I don't understand is why you didn't get a message like
Warning: External not found
"dynload.o"
Many C compilers (or linkers, I forget which) cause linker symbols of
this form to be defined. Perhaps these are examined by debuggers; I'm
not sure. Whatever the reason, this would explain why there was no
"external not found" message.
8 Aug 1994 18:10
Sockets sample code
Jonathan Rees <jar <at> martigny.ai.mit.edu>
1994-08-08 16:10:42 GMT
1994-08-08 16:10:42 GMT
Date: Sat, 23 Jul 94 14:37:24 -0500 From: jimb <at> totoro.bio.indiana.edu (Jim Blandy) The reason we're out of luck is that there is no way to deal with multiple return values at all using standard Scheme. Given that socket-server is going to return two values, established Scheme provides no correct way to call it. You have to use some kind of non-standard construction to receive its values. I don't understand what you're trying to say here. Neither SOCKET-SERVER nor CALL-WITH-VALUES is part of IEEE Scheme; but then neither is MAKE-TABLE or DEFINE-SYNTAX or any of hundreds of other things built into Scheme 48. To use the results of SOCKET-SERVER, you need to use CALL-WITH-VALUES or RECEIVE, just as to use the result of MAKE-TABLE, you have to use TABLE-REF and TABLE-SET!. Jonathan
8 Aug 1994 18:52
8 Aug 1994 19:00
8 Aug 1994 19:24
Sockets sample code
Jim Blandy <jimb <at> totoro.bio.indiana.edu>
1994-08-08 17:24:37 GMT
1994-08-08 17:24:37 GMT
> Date: Sat, 23 Jul 94 14:37:24 -0500 > From: jimb <at> totoro.bio.indiana.edu (Jim Blandy) > > The reason we're out of luck is that there is no way to deal with > multiple return values at all using standard Scheme. Given that > socket-server is going to return two values, established Scheme > provides no correct way to call it. You have to use some kind of > non-standard construction to receive its values. > >I don't understand what you're trying to say here. Neither >SOCKET-SERVER nor CALL-WITH-VALUES is part of IEEE Scheme; but then >neither is MAKE-TABLE or DEFINE-SYNTAX or any of hundreds of other >things built into Scheme 48. To use the results of SOCKET-SERVER, you >need to use CALL-WITH-VALUES or RECEIVE, just as to use the result of >MAKE-TABLE, you have to use TABLE-REF and TABLE-SET!. Yes... but... *bewildered look* I don't debate that the use of CALL-WITH-VALUES is necessary. However, Chris seemed to wish it wasn't used, apparently being unaware that that was impossible; I wanted to point out that we didn't have much choice in the matter. Example code should require a basic understanding of the feature being demonstrated, and a familiarity with basic Scheme; it should require an understanding of as few of Scheme 48's extensions as possible. This is especially true given the lack of reasonable documentation. Calling the documentation unreasonable is not an insult to Scheme 48's(Continue reading)
RSS Feed