This is the mail archive of the guile@cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: "environment" unsuitable name for top-level environment


I'm sure most people interested in this discussion already are aware
of this, but here's a clarification regarding how lexical environment
looks like from the inside:

(define y 3)

(define (foo x)
  (let ((z 5))
    (* x y z))

(foo 2)

The lexical environment at the multiplication expression will have an
internal representation which looks somewhat like this:


head  frame1 frame2 top level
 _ _    _ _    _ _    _ _
|_|_|->|_|_|->|_|_|->|_|_|
 |      |      |      |
type   z=5    x=2   "Jim proposal thing"
                    y=3
                    *=#<primitive-procedure *>
                    foo=#<procedure foo>
                    ...

The lexical environment denoted by the environment specifier
`null-environment' passed as second argument to `eval' will be
represented like this:
 _ _    _ _
|_|_|->|_|_|
 |      |
type  "Jim proposal thing"
      <empty>

(This is, BTW a top level environment.)

What I'm saying is that it is the above two things which are
`environments' in the true sense, while the "Jim proposal thing" is
really a part of the implementation of environments (in fact, it's not
even a top level environment if we are strict).

So, it's not very good to call the "Jim proposal thing" `environment'.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]