Number: 147

Date: 17-Mar-84  0':28':09

Submitter: Sannella.PA

Source: desRivieres.pa

Subject: Add warning in OPENLAMBDA doc about using ARG names not in BODY

Lisp Version: 1-Mar-84

Description: '
Date': 15 Mar 84 18':43 PST'
From': desRivieres.pa'
Subject': Lisp': OPENLAMBDAs and FETCH'
To': LispSupport.pa'
cc': desRivieres.pa'
Lisp-System-Date':  1-Mar-84 14':24':22'
Machine-Type': Dorado'
'
It appears that the compiler is substituting into qualified field references on FETCH and REPLACE expressions.  For example, if FOO is defined to be'
'
   (OPENLAMBDA (ENV)'
       (FETCH (MY-RECORD-TYPE ENV) OF BAR))'
'
then (FOO NIL) will expand to'
'
   (FETCH (MY-RECORD-TYPE NIL) OF BAR)'
'
which, fortunately, won''t compile.  Would it be possible to prevent the compiler from substituting into these contents?'
'
---Jim '
'
-----'
'
Date':  6 Apr 84 17':14 PST'
From': Masinter.pa'
Subject': AR#147'
To': Sannella'
cc': desRivieres'
'
After some reflection, I''ve decided that Jim''s request far exceeds the original scope of OPENLAMBDA (which reserves the right to be a ''substitution macro''.)'
'
Jim, if you want the semantics of LAMBDA, use LAMBDA.'
'
Michael': I cannot find using IM.INSPECTOR any referent to OPENLAMBDA where I could insert this comment. Would you change this into an AR on Documentation, please? '
'
The idea is to add a note in the description of OPENLAMBDA on P 5.18 that says': OPENLAMBDA assumes that it can substitute literally the actuals for the formals in the body of the macro if the actual is side-effect free or a constant. Thus, you should be careful to use names in ARGS which don''t occur in the BODY.'


Workaround: do not use formals in OPENLAMBDA which are the same as any token other than an identifier.'


Test Case: 

Edit-By: masinter.PA

Edit-Date: 13-Jul-84 17':28':53

Attn: Documentation

Assigned To: 

In/By: 

Disposition: 

System: Language Support

Subsystem: Compiler, Code Format

Machine: 

Disk: 

Microcode Version: 

Memory Size: 

File Server: 

Server Software Version: 

Difficulty: 

Frequency: Everytime

Impact: Moderate

Priority: Unlikely

Status: Open

Problem Type: Documentation

Source Files: