unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: John Cowan <cowan@ccil.org>
To: Zelphir Kaltstahl <zelphirkaltstahl@posteo.de>
Cc: Guile User <guile-user@gnu.org>
Subject: Re: library vs define-module issue
Date: Sat, 1 Aug 2020 09:40:12 -0400	[thread overview]
Message-ID: <CAD2gp_Q1PTFeHU0OfXA3LQ0qpsB5Y-cCg_+NtxgYsTvc+BVH7Q@mail.gmail.com> (raw)
In-Reply-To: <d204807f-0373-781f-f837-054108a25e92@posteo.de>

On Sat, Aug 1, 2020 at 8:02 AM Zelphir Kaltstahl <zelphirkaltstahl@posteo.de>
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


  reply	other threads:[~2020-08-01 13:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-01 12:01 library vs define-module issue Zelphir Kaltstahl
2020-08-01 13:40 ` John Cowan [this message]
2020-08-01 14:46   ` Zelphir Kaltstahl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAD2gp_Q1PTFeHU0OfXA3LQ0qpsB5Y-cCg_+NtxgYsTvc+BVH7Q@mail.gmail.com \
    --to=cowan@ccil.org \
    --cc=guile-user@gnu.org \
    --cc=zelphirkaltstahl@posteo.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).