Jonathan Rees | 1 Aug 1994 20:55
Picon
Picon

Calling scheme as DLL

I think the VM-RETURN primitive might do what you want.  Cf.
doc/call-back.txt and the VM sources.  Perhaps Richard can provide
more information.
Jonathan

Jonathan Rees | 1 Aug 1994 21:33
Picon
Picon

bug in shadowing logic, or something


> (define (foo) write)
> (define write write)
> ,collect
Before: 
Error: exception
       (code-vector-ref '#{Code-vector 125} -2500942)
1> 

jamies | 3 Aug 1994 22:59
Picon

Externals problems in Scheme 48 0.36

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)

kelsey | 4 Aug 1994 00:03
Picon

Re: Externals problems in Scheme 48 0.36


   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)

Jay Nietling | 5 Aug 1994 10:06

scheme48 on nextstep 2.1


the sysconf call does not exist on nextstep 2.1.

after adjusting that code in unix.c scheme48 compiles and works.

-jay

Jonathan Rees | 5 Aug 1994 19:32
Picon
Picon

Externals problems in Scheme 48 0.36

   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.

Jonathan Rees | 8 Aug 1994 18:10
Picon
Picon

Sockets sample code

   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

(unknown)

unsubscribe

(unknown)

unsubscribe

Jim Blandy | 8 Aug 1994 19:24
Picon
Picon

Sockets sample code


>   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)


Gmane