larcenists / larceny

Larceny Scheme implementation
Other
202 stars 32 forks source link

How do I import Standard/socket into an r7rs library? #819

Closed ecraven closed 6 years ago

ecraven commented 6 years ago

I'd like to use Standard/socket.sch for some network connectivity, but I'm running larceny -r7rs. Is there a way to gain access to these functions while staying within r7rs mode?

WillClinger commented 6 years ago

I apologize for overlooking this question. The following should work:

(import (primitives r5rs:require))

(r5rs:require 'Standard/socket)

(import (primitives make-server-socket
                    server-socket-accept
                    make-client-socket
                    socket-input-port
                    socket-output-port))