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

Re: load



    From:    Stanley Letovsky <Letovsky>
    Subject: load

    Manual says load with no extension will check bin and source files;
    not true.

True if the filespec is in the documented "machine-independent" format
instead of in the undocumented string format.  E.g.
      (LOAD '(FOO BAR))
will load file #[Filename () FOO BAR BIN] if it exists, and
#[Filename () FOO BAR T] if it doesn't.

    It might be nice if load used a settable environment analogous
    to repl-env, so that if some parts of a file need to be evaluated
    in a particular environment once could simply wrap them in a
    (BIND (((LOAD-ENV) *the-desired-environment*))
       do stuff
      )

I don't quite understand this.  You can pass an environment to LOAD
to load the file into a given environment.  Doing a BIND can't possibly
do anything with the lexical environment of the body of the BIND.
If you want a way to evaluate some block of code in a different
environment then you're talking about introducing a new primitive
into the language, not changing the behavior of one small component
of the runtime system (LOAD).

Primitives of this sort have been discussed in the past.  One possible
form would be a COMPILED-CODE special form which would evaluate to
a compiled expression, so you could do e.g.
      (RUN-COMPILED-CODE (COMPILED-CODE (DEFINE FOO 34))
                         *BAZ-ENV*)
I am wary of this kind of thing because it's so unconstrained.  You
have to realize that at this level you're not just dealing in new
features but in new semantics; there's a big difference.