[R] terminology for frames and environments

Peter Dalgaard p.dalgaard at biostat.ku.dk
Mon Jun 14 13:59:06 CEST 2004

John Maindonald <john.maindonald at anu.edu.au> writes:

> I have found it helpful, in trying to explain (to myself and others)
> what happens, to say that there is both a lexical stack and a call
> stack.  Is that a legitimate use of terminology?

Slightly inaccurate I'd say. Both are actually trees, since multiple
calls can have the same parent (due to eval() and lazy evaluation) and
multiple environments can share the same enclosing environment. 

Since the trees are only connected by arrows pointing towards the
root, they just *look like* a stack of frames when viewed from one of
the branches. The only true stack structure is the context stack,
which holds the information on where to return from the current call.

   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907

More information about the R-help mailing list