Number: 1317

Date:  1-Jun-84 16':17':02

Submitter: Sannella.PA

Source: JonL.pa

Subject: Improve doc of exactly what stackframe is stored in a FUNARG

Lisp Version: 

Description: '
Date': 25 May 84 18':18 PDT'
From': JonL.pa'
Subject': FUNARG lossages, and PROC-created toplevels.'
To': Cooper.pa, Wallace.pa, DesRivieres.pa'
cc': JonL.pa, vanMelle, LispSupport, Bobrow, Newman.es'
'
Following piece of mail from Ron Newman shows a flaw in the Interlisp-D implementation of FUNCTION -- namely that it creates a "private" stackframe to hold the environment mentioned in the "alist" arg, rather than sharing with the lexically-enclosing environment.'
'
...'
'
     ----- Begin Forwarded Messages -----'
'
Date': 25 May 84 15':29':24 PDT (Friday)'
Subject': Re': FUNARG lossages'
In-reply-to': Your message of 25 May 84 15':22 PDT'
To': JonL.pa'
From': Ron Newman <Newman.es>'
'
. . . '
'
10←  (PROG (V)'
  (SETQ V ''OLDVALUE)'
  (SETQ G1 (FUNCTION (LAMBDA () V) (V)))'
  (SETQ V ''NEWVALUE))'
NIL'
'
11← (APPLY G1)'
OLDVALUE'
'
12← (PROG (V)'
  (SETQ V ''OLDVALUE)'
  (SETQ G2 (LIST ''FUNARG ''(LAMBDA () V) (STKNTH -1)))'
  (SETQ V ''NEWVALUE))'
NIL'
'
13← (APPLY G2)'
NEWVALUE'
'
     ----- End Forwarded Messages -----'
'
-----'
'
Date': 28 May 84 13':48 PDT'
From': Bobrow.pa'
Subject': Re': FUNARG lossages, and PROC-created toplevels.'
In-reply-to': JonL.pa''s message of 25 May 84 18':18 PDT'
To': JonL.pa'
cc': Cooper.pa, Wallace.pa, DesRivieres.pa, vanMelle.pa, LispSupport.pa, Bobrow.pa, Newman.es'
'
With respect to the FUNARG, the independence of the values of V in '
(SETQ G1 (FUNCTION (LAMBDA () V) (V)))'
from the environment is advertised as a feature in the manual.'
p 5.16'
danny'
'
-----'
'
Date': 29 May 84 11':33 PDT'
From': desrivieres.pa'
Subject': Re': FUNARG lossages, and PROC-created toplevels.'
In-reply-to': JonL.pa''s message of 25 May 84 18':18 PDT'
To': JonL.pa'
cc': Cooper.pa, Wallace.pa, DesRivieres.pa, vanMelle.pa, LispSupport.pa, Bobrow.pa, Newman.es'
'
The obvious answer': the rooting should be to the environment in which the user''s input is being EVALed.'
'
....'
'
-----'
'
Date': 29 May 84 12':29 PDT'
From': JonL.pa'
Subject': Re': FUNARG lossages, and PROC-created toplevels.'
In-reply-to': Bobrow.pa''s message of 28 May 84 13':48 PDT'
To': Bobrow.pa'
cc': JonL.pa, Cooper.pa, Wallace.pa, DesRivieres.pa, vanMelle.pa, LispSupport.pa, Newman.es'
'
The documentation appears, to me at least, to be contradictory.  Page 5.15 describes the environment as "... where POS is a stack pointer to a frame that contains the variable bindings for those variables on ENV."  This implies, to me at least, that "the variables bindings" are those in the lexically enclosing environment.  '
'
Page 5.16 is even more confusing':  "However, this [the running of the funarg] is done within the environment of the call to MAKECOUNTER where FUNCTION was executed . . . even after MAKECOUNTER has finished executing."'
'
Admittedly, two examples elucidate the copy-on-creation behaviour, but if this is to be a feature (and I can see reasons for doing so -- parameterized lambdas -- then the documentation sure needs a re-working.'
'
-- JonL --'
'


Workaround: 

Test Case: 

Edit-By: masinter.PA

Edit-Date: 13-Jul-84 18':07':03

Attn: Documentation

Assigned To: 

In/By: 

Disposition: 

System: Language Support

Subsystem: Stack and Interpreter

Machine: 

Disk: 

Microcode Version: 

Memory Size: 

File Server: 

Server Software Version: 

Difficulty: Moderate

Frequency: Everytime

Impact: Moderate

Priority: Perhaps

Status: Open

Problem Type: Documentation

Source Files: