* r6rs and posix sockets
@ 2021-01-23 1:00 Rohan Drape
2021-01-23 5:10 ` John Cowan
0 siblings, 1 reply; 3+ messages in thread
From: Rohan Drape @ 2021-01-23 1:00 UTC (permalink / raw)
To: guile-user
hello list
a very simple question i hope
how do we access the guile posix/sockets functions from within an r6rs
library?
in ikarus there is (import (ikarus)), is it something similar?
i see they are automatically present in the interpreter
best,
rohan
$ guile --r6rs
GNU Guile 3.0.4
[...]
scheme@(guile-user)> socket
$1 = #<procedure socket (_ _ _)>
scheme@(guile-user)>
$ cat test.scm
#!r6rs
(library (test)
(export udp-open)
(import (rnrs))
(define udp-open
(lambda (h p)
(let ((s (socket PF_INET SOCK_DGRAM 0)))
(connect s AF_INET (inet-pton AF_INET h) p)
(list s h p)))))
$ guile --r6rs
GNU Guile 3.0.4
[...]
scheme@(guile-user)> (import (test))
;;; compiling /home/rohan/opt/lib/r6rs/test.scm
;;; test.scm:9:0: warning: possibly unbound variable `socket'
;;; test.scm:9:0: warning: possibly unbound variable `PF_INET'
;;; test.scm:9:0: warning: possibly unbound variable `SOCK_DGRAM'
[...]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: r6rs and posix sockets
2021-01-23 1:00 r6rs and posix sockets Rohan Drape
@ 2021-01-23 5:10 ` John Cowan
2021-01-23 8:53 ` Rohan Drape
0 siblings, 1 reply; 3+ messages in thread
From: John Cowan @ 2021-01-23 5:10 UTC (permalink / raw)
To: Rohan Drape; +Cc: guile-user
(import (guile)) does the trick.
On Fri, Jan 22, 2021 at 8:59 PM Rohan Drape <rohan.drape@gmail.com> wrote:
> hello list
>
> a very simple question i hope
>
> how do we access the guile posix/sockets functions from within an r6rs
> library?
>
> in ikarus there is (import (ikarus)), is it something similar?
>
> i see they are automatically present in the interpreter
>
> best,
> rohan
>
> $ guile --r6rs
> GNU Guile 3.0.4
> [...]
> scheme@(guile-user)> socket
> $1 = #<procedure socket (_ _ _)>
> scheme@(guile-user)>
> $ cat test.scm
> #!r6rs
> (library (test)
> (export udp-open)
> (import (rnrs))
> (define udp-open
> (lambda (h p)
> (let ((s (socket PF_INET SOCK_DGRAM 0)))
> (connect s AF_INET (inet-pton AF_INET h) p)
> (list s h p)))))
> $ guile --r6rs
> GNU Guile 3.0.4
> [...]
> scheme@(guile-user)> (import (test))
> ;;; compiling /home/rohan/opt/lib/r6rs/test.scm
> ;;; test.scm:9:0: warning: possibly unbound variable `socket'
> ;;; test.scm:9:0: warning: possibly unbound variable `PF_INET'
> ;;; test.scm:9:0: warning: possibly unbound variable `SOCK_DGRAM'
> [...]
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-01-23 8:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-23 1:00 r6rs and posix sockets Rohan Drape
2021-01-23 5:10 ` John Cowan
2021-01-23 8:53 ` Rohan Drape
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).