From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Zelphir Kaltstahl Newsgroups: gmane.lisp.guile.user Subject: Re: library vs define-module issue Date: Sat, 1 Aug 2020 16:46:42 +0200 Message-ID: <6037dcbe-cd52-3964-9aac-016ab424dc3d@posteo.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6264"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Icedove/68.8.0 Cc: Guile User To: John Cowan Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Sat Aug 01 16:47:08 2020 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 1k1smy-0001Wb-0t for guile-user@m.gmane-mx.org; Sat, 01 Aug 2020 16:47:08 +0200 Original-Received: from localhost ([::1]:46478 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k1smv-0000QY-Ef for guile-user@m.gmane-mx.org; Sat, 01 Aug 2020 10:47:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56052) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k1sme-0000O0-MA for guile-user@gnu.org; Sat, 01 Aug 2020 10:46:49 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:46988) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k1smc-0005yi-31 for guile-user@gnu.org; Sat, 01 Aug 2020 10:46:48 -0400 Original-Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 428AA160062 for ; Sat, 1 Aug 2020 16:46:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1596293204; bh=WDMiy4tMdHVkMKJRGMs9sHHlf5OzUkZi8sn7/NMZqNU=; h=Subject:To:Cc:From:Date:From; b=og5QcoQyb0mnko7t358xWL8zJLRzRJR5G1fnoCgzgNsP96vXVSrqcj8RuGKl7o6TL uy+NZ2e+Q/2s1LKIHl5GWt0SDmE+9SlmCQzehEVwO4yjyfTjmBMDpQ5cy4V1Q3uTeM iDkg77sICQ37SSmjIpTXDMnJkQl03D/AaP+uTKx9tazSaHShnmf9Ok0DZ0JidsMf3a OowYl4y2Iqrxsr0O/pecKVelQAYU357D9kewrzlnMflhtgKn85LLESRHu+dC1rHiHb UxWKpZ3v7I6tJ1WVzoXsb8MgkQVhRzqiqh/NffLDDE7kkxjfJBbU1C5yxd5rMzMZfO VYVjqeRvVjj5Q== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4BJn6C3pZKz9rxP; Sat, 1 Aug 2020 16:46:43 +0200 (CEST) In-Reply-To: Content-Language: en-US Received-SPF: pass client-ip=185.67.36.65; envelope-from=zelphirkaltstahl@posteo.de; helo=mout01.posteo.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/01 10:12:33 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=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:16764 Archived-At: Thanks John! This solved the problem. I now have it like this: ~~~~START~~~~ (library (geometry (0 0 1)) (export point make-point get-point-label get-point-coords vector->point) (import (rnrs base) (only (guile) lambda*) ;; structs (srfi srfi-9) (srfi srfi-9 gnu) ;; fold and list operations (srfi srfi-1))) ... (other code) ... ~~~~~END~~~~~ and I can import that just fine. Are all forms, which are usually available when using (define-module ...) exported in the import set (guile)? If not, where would I look for them? Using (help identifier) inside geiser helps. It shows me for example: ~~~~START~~~~ scheme@(guile-user)> (help define) No documentation found for: (rnrs base): define ~~~~~END~~~~~ Which tells me what I would need to import when using (library ...). Best regards, Zelphir On 01.08.20 15:40, John Cowan wrote: > > > On Sat, Aug 1, 2020 at 8:02 AM Zelphir Kaltstahl > > wrote: >   > > ;;; geometry.scm:25:0: warning: possibly unbound variable `define' > ;;; geometry.scm:26:2: warning: possibly unbound variable `lambda*' > > What am I doing wrong? Why is everything unbound, even core forms like > define or cond? Perhaps I need to import some base thing when using > (library …)? > > > Exactly.  You have to import (rnrs base) or else (guile), because the > global environment is empty at the start of an R[67]RS library > definition.  This is deliberate so that you can choose an entirely > different base library if you wish.  Similarly, Chicken provides both > (scheme base) and (chicken base), and Chibi provides both (scheme > base) and (chibi), although (chibi) is smaller than (scheme base) > rather than larger, in keeping with Chibi's goals. > > As a matter of style, I recommend importing the standard base library > and then bringing in anything Guile-specific with (import (only > (guile) ...)).  This advice also applies to Chibi, but not so much to > Chicken unless you are specifically using the R7RS mode. > > > > John Cowan          http://vrici.lojban.org/~cowan       >  cowan@ccil.org > Is not a patron, my Lord [Chesterfield], one who looks with unconcern > on a man struggling for life in the water, and when he has reached ground > encumbers him with help?        --Samuel Johnson > -- repositories: https://notabug.org/ZelphirKaltstahl