bug-kawa
[Top][All Lists]
Advanced

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

[Bug-kawa] [bug #47433] Strange Environment when kawa.repl is passed a f


From: Per Bothner
Subject: [Bug-kawa] [bug #47433] Strange Environment when kawa.repl is passed a file without -f
Date: Wed, 16 Mar 2016 23:54:50 +0000
User-agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:44.0) Gecko/20100101 Firefox/44.0

Update of bug #47433 (project kawa):

                  Status:                    None => Invalid                

    _______________________________________________________

Follow-up Comment #1:

Scheme's concept of "top-level environment" is a weird beast, and doesn't
really mix well with the R6RS/R7RS idea of modules/libraries.  If you don't
use -f, then the file is an "implicit module", and the define is lexical. It
doesn't automatically get put in the dynamic environment.  It may get added to
the dynamic environment when the module is required/imported, as part of the
magic to deal with the REPL.
Read the "Modules and how they are compiled to classes" for lots more detail
than you probably want.

In general, try avoid using environment-bound?, the dynamic environment, eval,
or load (as opposed to import or require).  If you do, the code will be
cleaner, faster and the compiler can catch errors more easily.  Of course
those features have their uses, but people thend to way overuse them.

If you really need to define a variable in the dynamic environment, use
define-variable instead of plain define.  Note that define-variable has
limited use, but can be suitable for dynamic binding and fluid-let.

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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