Number: 2139

Date: 11-Sep-84 11':39':56

Submitter: Sannella.PA

Source: kaplan.pa

Subject: Compiling (DECLARE (USEDFREE (A B C))) causes code to be changed

Assigned To: 

Attn: Masinter, Kaplan

Status: Open

In/By: 

Problem Type: Bug

Impact: Moderate

Difficulty: Moderate

Frequency: 

Priority: Perhaps

System: Programming Environment

Subsystem: DWIM

Machine: 1132

Disk: 

Lisp Version:  8-Sep-84 01':22':25

Source Files: 

Microcode Version: 5124

Memory Size: 4096

File Server: 

Server Software Version: 

Disposition: '
["masinter" "13-Sep-84 14':35':19" Description':]'
["masinter" "13-Sep-84 14':36':18" Attn': Difficulty':(->Moderate) System':(Language% Support->Programming% Environment) Subsystem':(Compiler,% Code% Format->DWIM) Disposition': Description': Edit-By': Edit-Date':]

Description: '
From': kaplan.pa'
Date':  8-Sep-84 11':26':50 PDT'
Subject': USEDFREE problem'
To': Lispsupport'
'
There seems to be some untoward consequences of dwimifying are compiling code which has a technically illegal USEDFREE declaration.'
'
In the examples I''ve seen (in some of Martin Kay''s code), he had a declaration of the form'
'
(DECLARE (USEDFREE (A B C)))   [note the incorrected parens enclosing the varlist]'
'
When dwim or the compiler (not sure which) walked over code that had this declaration and then later references the variable A, it seemed like the code itself was getting smashed so that expressions such as'
'
(push A FOO)'
'
were getting smashed to'
(push (A B C) FOO)-- and the list (A B C) seemed to be EQ to the list in the USEDFREE declaration  (i.e., Dedit wouldn''t print it twice).'
'
Don''t know whether it is worth tracking thru to find where the smashing is taking place.  Simplest thing might be to simply put a test in USEDFREE, GLOBALVARS, maybe SPECVARS, LOCALVARS interpreter to either give an error/warning if any of the vars is not a bindable litatom--and certainly not to push them on any system lists.'
'
--Ron'
'
[LMM': I''m pretty sure the problem is that DWIM is consing up a spelling list from the context and doesn''t check and thus creates a spelling list with (A B C D) on it. Fixspell comes along and thinks it is a SYNONYM. I dunno whether to fix FIXSPELL to ignore synonyms where the CDR isn''t an atom or fix DWIM to be smarter about what spelling list it CONSes up.]'
'


Workaround: 

Test Case: 

Edit-By: masinter

Edit-Date: 13-Sep-84 14':36':19