[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

intercepting undefined function errors



    Date: Wed, 5 Aug 87 12:34 EDT
    From: Jeffrey P. Golden <jpg@allegheny.scrc.symbolics.com>

    We are running Beta Version 2.00 on the Apollo.

    As you may know, MACSYMA has long had an "autoload" feature 
    whereby an "undefined function" may have an AUTOLOAD property 
    which indicates a file which contains the function's definition. 
    The file is loaded when a call to the undefined function is 
    attempted.  (This scheme was very useful in the days of limited 
    address space.  It is still used to autoload a few "share" files.)

I wrote a local hack that does the same thing, but in a different way:
Vdefun takes a function-name and a file-name (or system name).  It
creates a function that has the same name and takes &rest args.  The
function loads the file and recalls the function.  This takes alittle
more space than the maclisp property method, but it has the advantage that it
the compiler does not complain of undefined functions, it is easy to
write, and it works on any commonlisp.

My implementation does not deal with the source-file-name issue very
well (this is an issue on our locally hacked lucid, and symbolics
machines; hurray for meta-.)

I could send you the code, but I would rather someone rewrite it because
it is simple and mine is krufty.

    To make it work under Lucid, we need a way to intercept 
    undefined function errors.  (It would be interesting if Lucid had 
    an autoload capability as did Maclisp, but I'm not expecting that.)
    We are willing to intercept all errors if need be as long as we can 
    detect which error we've got, handle those we can, and decline to 
    handle the others. 

    I cannot find the capability I need in the Lucid documentation. 
    Can someone tell me if there is a way to do what I want in Lucid?

    Also, is there a mailing list for asking questions like this 
    directly of Lucid Inc.?