Number: 1826

Date: 13-Aug-84 11':49':59

Submitter: Sannella.PA

Source: Sannella.PA

Subject: Find out who calls (HASDEF ''FOO ''?), and why it fails

Assigned To: Masinter

Attn: 

Status: Fixed

In/By: 

Problem Type: Documentation

Impact: Annoying

Difficulty: 

Frequency: 

Priority: Perhaps

System: Programming Environment

Subsystem: File Package

Machine: 

Disk: 

Lisp Version: 

Source Files: 

Microcode Version: 

Memory Size: 

File Server: 

Server Software Version: 

Disposition: TYPESOF(NIL ?) returns NIL; HASDEF of multiple types checks for them all. Thus HASDEF(X ?) returns X if X has a definition, while HASDEF(X (FNS VARS)) returns X if X is either a function or a variable.'
["masinter" "27-Aug-84 23':53':08" Assigned% To': Attn': Status':(Open->Fixed) Disposition':]

Description: '
Date': 23 Jul 84 23':27 PDT'
From': JonL.pa'
Subject': Lisp': HASDEF seems lost in typical call from DEdit'
To': LispSupport.pa'
cc': LispCore↑'
'
Lisp System Date': 19-Jul-84 19':03':54'
Machine': Dorado (Pool-CIS)'
Microcode version': 24,4'
Memory size': 10000'
Frequency':  Always'
Impact':  Moderate'
'
Recently it seems that (HASDEF ''FOO ''?) has developed serious problems.  Just try it in a recent Lisp.sysout -- it takes interminable amount of time in this sysout (Jul 19) doing a PRETTYDEF to a {core} file -- anyone able to explain why it should to this when the "name" is NIL ?'
'
In the sysout of Jul 22, it breaks with an error msg about'
"no defined way to dump or obtain the definition of'
(VARS)"'
'
Anyone know what''s going on?'
'
-- JonL --'
'
-----'
'
From': masinter.pa'
Date': 24-Jul-84  1':33':09 PDT'
Subject': Re': Lisp': HASDEF seems lost in typical call from DEdit'
In-reply-to': JonL''s message of 23 Jul 84 23':27 PDT'
To': JonL'
cc': LispSupport, LispCore↑'
'
I also noticed that HASDEF seemed to be calling INFILEP on all of the files in FILELST when I had FILELST loaded.'
'
I think this time that I *didn''t* break it, somebody else did.'
'
-----'
'
Date': 24 Jul 84 15':39 PDT'
From': JonL.pa'
Subject': Re': Lisp': HASDEF seems lost in typical call from DEdit'
In-reply-to': masinter.pa''s message of 24-Jul-84  1':33':09 PDT'
To': masinter.pa'
cc': JonL.pa, LispSupport.pa, LispCore↑.pa'
'
Are you sure that calling INFILEP is new behaviour?  it seems to be coming form the call to GETDEFFROMFILE, which sometimes winds up scanning the file for the definition therein.'
'
-- JonL --'
'
-----'
'
Date': 24 Jul 84 15':43 PDT'
From': Sannella.pa'
Subject': "HASDEF problem" -- GLOBALRESOURCES filepkgcom still not quite right'
To': LispCore↑.pa'
cc': Sannella.pa'
'
The problem that Jonl reported, that (HASDEF NIL ''?) breaks with "no defined way to dump or obtain the definition of (VARS)", is a non-problem.  It turns out that noone calls HASEF with these args.'
'
The reason Jonl reported this problem was that he had determined (incorrectly) that this was the function call within DEDIT that was causing DEdit to fail when one asked to edit an object with no in-core definition.'
'
The REAL problem':  In the current loadup, recursively calling DEdit to load and edit an object that does not have an in-core definition gives an error "(RESOURCES definition not found)".  Jonl and I tracked this down to the fact that FILEPKGTYPES contains the name GLOBALRESOURCES, along with (GLOBALRESOURCES . RESOURCES).  Essentially, it looks like the problem of "how to define GLOBALRESOURCES as a synonym of RESOURCES" has not yet been solved.'
'
Quick fix, for those who want to get some work done':'
'
(DREMOVE ''GLOBALRESOURCES FILEPKGTYPES)'
'
-----'
'
Date': 24 Jul 84 17':37 PDT'
From': JonL.pa'
Subject': Re': Lisp': HASDEF seems lost in typical call from DEdit'
In-reply-to': JonL.pa''s message of 23 Jul 84 23':27 PDT'
To': Kaplan'
cc': LispSupport.pa, '
'
Apparently (HASDEF <foo> ''?) is lesser used than I thought, so this bug may have been around for a long time.  It seems to revolve on the line in GETFILEPKGTYPE '
    (COND ...'
        ((EQ TYPE ''?)'
         (TYPESOF NAME)) '
          ...)'
where NAME is typically NIL.  Ron':  Does this look right?  This means that one might call GETFILEPKGTYPE with a litatom type, but get back a list of answers.'
'
-- JonL --'
'
-----'
'
From': masinter.pa'
Date': 24-Jul-84 20':12':19 PDT'
Subject': Re': Lisp': HASDEF seems lost in typical call from DEdit'
In-reply-to': JonL''s message of 24 Jul 84 15':39 PDT'
To': JonL'
cc': masinter, LispSupport, LispCore↑'
'
at one time , TYPESOF was tuned not to attempt to load the thing just to see if it was there. TYPESOF calls HASDEF which may call GETDEF with an OPTIONS list of (NODWIM FAST ... etc). I forget the details...'
'
-----'
'
Date': 24 Jul 84 20':57 PDT'
From': JonL.pa'
Subject': Re': Lisp': HASDEF seems lost in typical call from DEdit'
In-reply-to': masinter.pa''s message of 24-Jul-84 20':12':19 PDT'
To': masinter.pa'
cc': JonL.pa, LispSupport.pa, LispCore↑.pa'
Reply-to': JonL.pa'
'
I think we''re chasing a red herring -- as Mike discovered, (HASDEF <foo> ''?) isn''t an interesting case.  [incidentally, it does look as though it''s the call to TYPESOF in GETFILEPKGTYPE, triggered by the "type" of ? that causes the stuff to be loaded from file].'
'
-- JonL --'
'
'


Workaround: 

Test Case: 

Edit-By: masinter

Edit-Date: 27-Aug-84 23':53':11