From: 90-33556  Geldenhuys  J
Subject: How do you save a package ?
Date: 
Message-ID: <1993Mar10.103245.6365@hippo.ru.ac.za>
I am using Ibuki Common Lisp and I work in packages.  I want to
save all the symbols I have defined when I quit working.  Does
anyone know how to get all the symbols and save them.

For instance, if I said (setf x 10), (defun fac ...), etc.  I
want all those definitions to be there when I restart.  I have
tried doing it with (apropos) and (do-all-symbols ..) but
neither seems to work.

Any ideas ?

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Jaco Geldenhuys
University of Stellenbosch
····@cs.sun.ac.za
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

From: Barry Margolin
Subject: Re: How do you save a package ?
Date: 
Message-ID: <1nl89kINNg5k@early-bird.think.com>
In article <·····················@hippo.ru.ac.za> ····@cs.sun.ac.za (90-33556  Geldenhuys  J) writes:
>I am using Ibuki Common Lisp and I work in packages.  I want to
>save all the symbols I have defined when I quit working.  Does
>anyone know how to get all the symbols and save them.

It's usually considered better style to do all your definitions in a source
file that you load into Lisp, rather than defining things in the
interpreter and saving them out.  There are also some Emacs-to-Lisp
interface packages that allow you to write a definition in its Emacs source
buffer and then send that definition to Lisp immediately.

I don't know of a portable way to do what you want.  You could write
something that uses DO-ALL-SYMBOLS and writes a source file that will
reconstruct all the variable bindings, function definitions, and property
lists.  However, if any of the objects don't have readable printed
representations, or the functions are compiled, there may not be any way to
represent them in the source file (perhaps the publically-available
SAVE-OBJECT function could help here, though).

Most Lisps have a facility for saving an entire workspace out to a file and
restarting it later.
-- 
Barry Margolin
System Manager, Thinking Machines Corp.

······@think.com          {uunet,harvard}!think!barmar
From: Arun Welch
Subject: Re: How do you save a package ?
Date: 
Message-ID: <WELCH.93Mar10131618@foo.anzus.com>
In article <············@early-bird.think.com> ······@think.com (Barry Margolin) writes:

   It's usually considered better style to do all your definitions in a source
   file that you load into Lisp, rather than defining things in the
   interpreter and saving them out.

Only, of course, if you're working with a file-based implementation.
In a memory-based implementation like Medley you define things in the
interpreter and then save them out to files, and files are
considered databases of Lisp objects.  One rarely edits a file
directly, it's considered bad style :-).

...arun
----------------------------------------------------------------------------
Arun Welch
Anzus Consulting
·····@anzus.com
From: Scott McKay
Subject: Re: How do you save a package ?
Date: 
Message-ID: <19930310200836.1.SWM@SUMMER.SCRC.Symbolics.COM>
    Date: Wed, 10 Mar 1993 13:16 EST
    From: Arun Welch <·····@foo.anzus.com>

    In article <············@early-bird.think.com> ······@think.com (Barry Margolin) writes:

       It's usually considered better style to do all your definitions in a source
       file that you load into Lisp, rather than defining things in the
       interpreter and saving them out.

    Only, of course, if you're working with a file-based implementation.
    In a memory-based implementation like Medley you define things in the
    interpreter and then save them out to files, and files are
    considered databases of Lisp objects.  One rarely edits a file
    directly, it's considered bad style :-).

I have some questions, the answers to which I would find interesting, if
you have the time to answer.  I don't even know what Medley is -- please
forgive my ignorance.

For many programmers, files full of code are to be read like a piece of
"literature" (for lack of a better word).  That is, there is a notion
that the very organization of source files itself carries information and
intent.  It seems to me that what you describe (in two short sentences)
has the property that this intent is discarded once the so-called
"database of Lisp objects" has been saved.  How does Medley address this,
if indeed it addresses the issue at all?  How does it preserve things
like comments?  Are such things as indentation managed completely by the
environment, with no advice from the programmer at all?
From: Dan Rabin
Subject: Re: How do you save a package ?
Date: 
Message-ID: <RABIN.93Mar10220913@nuthatch.CS.Yale.Edu>
Scott McKay asks whether the Interlisp (and Interlisp-D, and Xerox
Lisp, and Medley) way of defining programs first, then filing them
away in a database (as opposed to using source files) harms the
literature-like organizational qualities of the program.

My answer is: undoubtedly, but there are compensating factors.  I
speak from the experience of having used a D-machine for about a
year after using a Symbolics for four years.

Some limitations on program-literacy are: Comments can only be placed
where a `nil' could be placed without altering the meaning of a
program, and program indentation is not under programmer control.
Order of inclusion of definitions is not easily controllable.

On the other hand, the fact that the programming tools can know a lot
about program files allows for many hook-based programming tricks that
experienced users of Interlisp-derived programming systems not only
use, but use effectively.  Such people tend to program *very* rapidly,
even by rapid-prototyping standards.  More ponderous, think-it-through
types like me tend not to like it.  It's hard to convey how odd it seems
to begin a project by typing the program instead of by deciding what
to call the first source file.

  -- Dan
From: Arun Welch
Subject: Re: How do you save a package ?
Date: 
Message-ID: <WELCH.93Mar11222155@foo.anzus.com>
In article <···················@nuthatch.CS.Yale.Edu> ·····@CS.Yale.Edu (Dan Rabin) writes:

   Scott McKay asks whether the Interlisp (and Interlisp-D, and Xerox
   Lisp, and Medley) way of defining programs first, then filing them
   away in a database (as opposed to using source files) harms the
   literature-like organizational qualities of the program.

   Some limitations on program-literacy are: Comments can only be placed
   where a `nil' could be placed without altering the meaning of a
   program, and program indentation is not under programmer control.

This is only true of Interlisp, as the langauge defines '*' as a
comment function with return values. The Common Lisp side of Medley
treats comments in the expected way.

   Order of inclusion of definitions is not easily controllable.

Huh? Order of inclusion is completely customizable, with a whole host
of functions for laying it out.

...arun
----------------------------------------------------------------------------
Arun Welch
Anzus Consulting
·····@anzus.com
From: Jason Trenouth
Subject: In-Memory vrs File-Oriented Lisp Editing (was Re: How do you save a package ?)
Date: 
Message-ID: <JASON.93Mar16142431@monty.harlqn.co.uk>
> Scott McKay asks whether the Interlisp (and Interlisp-D, and Xerox
> Lisp, and Medley) way of defining programs first, then filing them
> away in a database (as opposed to using source files) harms the
> literature-like organizational qualities of the program.

For a historical perspective on this discussion, see Sandewall's

	"Programming an Interactive Environment: The Lisp Experience"
	in
	"Interactive Programming Environments",
	Barstow, Shrobe, Sandewall (eds)
	McGraw Hill, 1984

It captures the exchanges between Erik Sandewall and Richard Stallman.
(Sandewall's article orginally appeared in ACM Computing Surveys,
10:1, 1978, pages 35-71)
--
_____________________________________________________________________________
| Jason Trenouth,                        | JANET: ·····@uk.co.harlqn        |
| Harlequin Ltd, Barrington Hall,        | TEL:   (0223) 872522             |
| Barrington, Cambridge CB2 5RG, UK      | FAX:   (0223) 872519             |