Path: utzoo!mnetor!uunet!husc6!bbn!uwmcsd1!ig!jade!ucbvax!cbosgd!osu-cis!tut!welch
From: welch@tut.cis.ohio-state.edu (Arun Welch)
Newsgroups: comp.lang.lisp
Subject: Re: lisp environments summary
Message-ID: <3044@tut.cis.ohio-state.edu>
Date: 9 Dec 87 18:57:03 GMT
References: <613@umbc3.UMD.EDU> <325@siemens.UUCP> <323@spar.SPAR.SLB.COM> <329@siemens.UUCP> <13253@think.UUCP>
Organization: The Ohio State University Dept of Computer and Information Science
Lines: 107
Keywords: Interlisp, Editing, Files

>From: barmar@think.COM (Barry Margolin)
>
>In article <329@siemens.UUCP> steve@siemens.UUCP (Steve Clark) writes:
>>  I maintain that the non-Interlisp systems are wrong, however.  It
>>is clearly more advanced to treat a file as a database of definitions of
>>functions, data, structures, etc. than to treat it as a string of characters
>>that might have been typed at the keyboard.  However, since the rest of the
>>world hasn't caught up yet, there are bound to be incompatibilities.
>
>It would not be appropriate for a general-purpose Lisp standard to
>require the Interlisp style of permanent storage of function
>definitions.  This style requires that a function editor be built into
>the Lisp system, and this may not be feasible or desirable in all
>implementations and/or environments.  While many Common Lisp
>implementations do include an editor, at least one notable one (Kyoto
>Common Lisp) would have a hard time doing so.
>
Well, yes and no.  While a particular function editor can't possibly be
built into a general-purpose Lisp standard, more hooks to one can be.
Interlisp, in it's native mode, defines a tty-based structure editor,
which is pretty powerful in it's own right. Most implementations of
Interlisp have then added their own editors on top of the basic
environment, for example Interlisp-10 used Emacs, Interlisp-D used
Dedit, and now XAIE uses Sedit. Which editor you use is settable by a
flag, but the basic effects of the editor remain the same across the
board. 

>I also wonder whether the Interlisp database is as powerful as the
>Common Lisp LOAD style.  I'm not very familiar with Interlisp, so bear
>with me.  A file to be loaded can contain other code besides
>definitions and declarations; it can contain immediate code to be
>executed.  Thus, the file LOAD-EVERYTHING.LISP could contain:
>
>(load "first-thing")
>(load "second-thing")
>(load "third-thing")
>(load "last-thing")
>
>How is this done in Interlisp?  If there is a way to do it, then
>what's the difference between that and LOAD?

To answer this question, I think it would be best if I start with a
quick introduction on how the database works, for those out there who
have never worked with an Interlisp system. 
Every file has a variable associated with it, called the COMS, which
is the database.  Thus, for the file FOO, there would exist a variable
FOOCOMS, which defines what's contained in FOO, what operations to
perform when loading foo, etc. Let's say that I want FOO to contain
the function definition for the function BAR, the variable definition
for the variable BAZ, which has the initial value 5, and for the file
RALPH loaded before the file FOO is loaded, and also, for the screen
background to be set to the blackshade after FOO is loaded. FOOCOMS
would then look like this:
((FILES RALPH)
 (FNS BAR)
 (VARS (BAZ 5))
 (P (CHANGEBACKGROUNDBORDER BLACKSHADE)))
After making the file, if someone were to load the file into their
system, it would load the file RALPH, defien the function BAR, and
declare thevariable BAZ to have the value 5, and change the screen
background to blackshade.  It's quite possible that RALPH would do
similiar things in its loadup too.  A COMS can contain more than just
these three sorts of things, like property lists, structure
definitiions, etc., but I just thought this would be a good example. 
SO, to answer the question, there are three ways to have a
LOAD-EVERYTHING behaviour.
1) Create a file, whose COMS consist of the database commands to load
those files,
2) Have the COMS of the first file load the second through nth files
3) have each file load the next file when it's done loading itself.

>How does Interlisp know which definitions are important to save?  I
>certainly wouldn't want it saving everything, since I constantly
>create little temporary functions and variables while debugging.  If
>the user has to save functions explicitly it seems like it would be
>hard to make sure you don't miss some.  I'm sure these problems have
>been solved, since I doubt Interlisp would have survived so long
>without solutions, but I'm curious how.
>

The simplest way is to call the function (FILES?).  This prints out a
list of all the things in the system that haven't been written to a
file yet, and prompts for files to put them in (You don't have to save
things you don't want to, though) . If you've actually been keeping
track of what you've defined, you can also insert them into a file
without the help of FILES?. After the COMS have been set up, one calls
the funciton MAKEFILE to write out the file to disk. If one want's one
can call the function MAKEFILES which calls FILES?  first, and then
remakes all the files which contain changed definitions too.


Its kind of unfortunate that the Interlisp philosophy and the
Mac/Zeta-lisp philosophies are so different.  There are a lot of neat
things in Interlisp which will probably go the way of the Dodo, which
will be a loss for the language. Interlisp vs. M/Zlisp discussions
also tend to carry a fair amount of religion with them, leading to
unconstructive interactions...


....arun



----------------------------------------------------------------------------
Arun Welch
Lisp Systems Programmer, Lab for AI Research, Ohio State University
welch@ohio-state.{CSNET,ARPA}