From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: John Cowan Newsgroups: gmane.lisp.guile.user Subject: Re: r6rs and posix sockets Date: Sat, 23 Jan 2021 00:10:51 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6276"; mail-complaints-to="usenet@ciao.gmane.io" Cc: guile-user To: Rohan Drape Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Sat Jan 23 06:11:39 2021 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l3BD1-0001Zp-Kl for guile-user@m.gmane-mx.org; Sat, 23 Jan 2021 06:11:39 +0100 Original-Received: from localhost ([::1]:54830 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l3BD0-0003Km-NL for guile-user@m.gmane-mx.org; Sat, 23 Jan 2021 00:11:38 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41974) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3BCY-0003KJ-2u for guile-user@gnu.org; Sat, 23 Jan 2021 00:11:10 -0500 Original-Received: from mail-qk1-x72f.google.com ([2607:f8b0:4864:20::72f]:45366) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l3BCU-0003ni-93 for guile-user@gnu.org; Sat, 23 Jan 2021 00:11:09 -0500 Original-Received: by mail-qk1-x72f.google.com with SMTP id r77so7206979qka.12 for ; Fri, 22 Jan 2021 21:11:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ccil-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Kf+l4M28n3UHjIMeBEuZRTl2dhCOfzP+xnoW/LEnXcM=; b=yHg0PES6p+tD4SmFjJt4yxXL/iV9fabgMB6uX5BZo7++2XSshSb9zulVkJ38Zq4zt4 qE2TIDs4U8qOQSw61+naSWJKW3AGpUqvjKpBCDhwi1rIUUDbrQXFNAtM38r8nDN3OsJE fI1SiNoDvxix8V3vRmFHp225RnZtdnWuhAA5wXY5/mnNvQ7DK7WKhNSGEdFyfuICW7p/ xhh8uhVz8NY58QxvIBF4D0Riagt6mC/gLDaFw7y7fxuH9opfdINHfUhtCPAc2iqrDzju lXWiGQCJ29wVn+flIOjMJLXM70KKY7gOfMtKi29eWBptvcDXJProu0+WWtC6eLF8ZU3g YKVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Kf+l4M28n3UHjIMeBEuZRTl2dhCOfzP+xnoW/LEnXcM=; b=Sqw2Xughbmvd30hOMi4WN6qobkBPDQub9ZsOohWu7DmVoOg5dpO6ATzJKkSNAvaZPq C92zyhJitzm3EIO25Mb5qcltZ8pu/MZyImmo5vmayLFpOvXCFjvDWh7SNkqJ2XCAeyKd gRcODmXS4DfjN55u3A2zPdRSIDnm0MsmfhmxxqzUhz/KbPzvpkzkBMmjMmN8I4Osluaz JmhETI+0uGG33/fVsnxRhl5qCLjBx3d28odFh4DJcPiEmHQI0rSVZnCBLVznBemdvSK3 RP0iNscBZXVXeE5p9twBq7AKL5h4QpHf35oKnz5sfnwa90i4yWZcgg2eXlbod0w9ms30 5MrQ== X-Gm-Message-State: AOAM531UopcB8NenP6+dmdcDAyJdn3ZC20yMqlvAjCUdB4JyNnnQE0Ja kY9Zv5OIqQf+MXiAJRraaxCjILMjTF16ErrLZKhLAg== X-Google-Smtp-Source: ABdhPJwZpHbmue45XILwQOtUD23va+lOB7YvJJbgRCveF8AfOkAKOKzkcnzM/unyHucv6RBpVTDZhtxoDdBwG863CEs= X-Received: by 2002:a37:418d:: with SMTP id o135mr8030999qka.426.1611378664511; Fri, 22 Jan 2021 21:11:04 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::72f; envelope-from=cowan@ccil.org; helo=mail-qk1-x72f.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:17185 Archived-At: (import (guile)) does the trick. On Fri, Jan 22, 2021 at 8:59 PM Rohan Drape 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 = # > 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' > [...] >