bug-kawa
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-kawa] [bug #43285] Require vs. load


From: Per Bothner
Subject: [Bug-kawa] [bug #43285] Require vs. load
Date: Tue, 23 Sep 2014 19:20:21 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0

Follow-up Comment #4, bug #43285 (project kawa):

By "lexical scope of x.scm" I mean file-level or module-level scope, similar
to a r7rs library.  If you read the r7rs specification section 5.6.1 page 28
you see "After all cond-expand library declarations are expanded, a new
environment is constructed for the library consisting of all imported
bindings."  The module-level scope is equivalent to this environment.  Note
since this environment is local to the module/library, it can be treated as a
purely lexical scope.  Think of it as an implicit file-level letrec*, but with
the option of exporting a subset of the bindings to another module. This scope
is "inside" the traditional top-level scope.

"I would say that foo is defined in the top-level scope (as it's neither
inside a module nor inside a lambda)."

It's defined in the module/library scope of y.scm.  When you (require "y.scm")
(or equivalently use R7RS import) the file y.scm is treated as an implicit
module/library.

("module" == "library" in this case.  The former is Kawa/R6RS terminology, the
latter is R7RS terminology.)

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?43285>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]