On Tue, 2009-06-02 at 16:33 +1000, Ramana Kumar wrote:
> I don't understand what "loads the file into the interaction
> environment" means. What kind of files are allowed? I am guessing the
> file should look like a script file? Must it start with an import?

load is from R5RS, before proper modules were available.  It's usually
something like:

  (define (load filename)
    (call-with-input-file filename
      (lambda (fip)
        (let loop ()
          (let ((x (get-datum fip)))
            (unless (eof-object? x)
              (eval x (interaction-environment))
              (loop)))))))

ERR5RS retains load, and to install libraries, it uses load.  Sometimes
people say "loading libraries", which means installing libraries in a
running Scheme system.  Ikarus, Larceny, and Ypsilon (and maybe others)
all install any libraries whose forms are evaluated in the interaction
environment (e.g. typed in the REPL or load'ed), which is conceptually
like defining the libraries, so it makes sense to say such libraries are
loaded because it fits with the traditional load which can evaluate
defines.  Ikarus's interaction environment is basically ERR5RS (but
there could be differences, I don't know all about ERR5RS, and I don't
know if its specification was completed).

-- 
: Derick
----------------------------------------------------------------

Reply via email to