Number: 1169

Date: 21-May-84 16':28':56

Submitter: Sannella.PA

Source: Feuerman.PASA

Subject: When a fn -> macro, FP doesn''t know calling fns should be recompiled

Lisp Version: 

Description: '
Date': 14 May 84 13':23':49 PDT (Monday)'
From': Feuerman.PASA'
Subject': File Package-Compiler Problem'
cc': 1100Support, Feuerman'
Sorry not to be using the official AR Submit form, but I don''t think we have a FULL.SYSOUT down here on Rosebowl yet.'
I had a problem with either the File Package or the compiler.  I had defined a rather short function (call it GNUDNIK).  GNUDNIK was stored out on a file, compiled, and then read back in as a compiled function.  Later, after doing some benchmarks, I decided it was faster to implement it as a MACRO.  So I put the equivalent form onto GNUDNIK''s MACRO property, performed (DELDEF ''GNUDNIK) so that I would be sure to be using the MACRO definition, and then edited the COMS variable to move GNUDNIK from the FNS list to the MACROS list.  I called (CLEANUP), and all worked fine.'
Then I started again from fresh, LOADing in the file that GNUDNIK was stored on.  However, this time when I got to the function that called GNUDNIK, I got a break window because it thought GNUDNIK was an undefined function.  I could execute GNUDNIK directly from the typein, but it wasn''t being found when in the compiled code.'
I suspect what happened was that the file package didn''t notice that the function that calls GNUDNIK needed to be recompiled to reflect the new link to the new way of calling GNUDNIK.  If this is true, shouldn''t this be a "right thing" (quoted from the Interlip manual) for the File Package to do?  If this isn''t true, what am I doing wrong?'
5/21/84 mjs'
Subject': Re': File Package-Compiler Problem'
In-reply-to': Feuerman.PASA''s message of 14 May 84 13':23':49 PDT (Monday)'
To': Feuerman.PASA'
cc': LispSupport, 1100Support.PASA'
I''ve thought about this problem, and I suspect that it is too hard to fix for the benifit gained.  The file package cannot know WHO calls this function-turned-macro without doing MACROSCOPE-type analysis, which you probably don''t want as the default.  I have submitted this as AR 1169': Fix or Doc': When a fn -> macro, FP doesn''t know calling fns should be recompiled.  Either it will get fixed (unlikely) or at least the manual should point out this info in the section on macros.'
Date': 21 MAY 84 23':45 PDT'
Subject': AR 1169, macro calls'
To':   Feuerman.pasa'
cc':   LispSupport'
Well, this is in fact a little known (undocumented?) feature of masterscope -- if you''ve analyzed functions and you change macros they call and they''re compiled, Masterscope will warn you. '
It doesn''t work if you haven''t Masterscope''d the file you are running in.'
I imagine this could be extended to work a little more automatically than it does, but I''m not sure exactly how.'
It certainly could be documented better.'
It *would* be possible to do an even better job of keeping track of source->compiled code dependencies -- in fact, I''ve heard that Symbolics is working on something of the very sort, just because macros are so pervasive in their Lisp.'


Test Case: 

Edit-By: masinter.PA

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

Attn: Lisp

Assigned To: 



System: Programming Environment

Subsystem: File Package



Microcode Version: 

Memory Size: 

File Server: 

Server Software Version: 

Difficulty: Hard

Frequency: Everytime

Impact: Moderate

Priority: Unlikely

Status: Open

Problem Type: Design - UI

Source Files: