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

Problems with packages?

    Date: 23 Apr 85  0234 PST
    From: Jon White <JLW@SU-AI.ARPA>
    ....I think we can best spend our broadcasted mail time focusing
    on questions like the following:
      (A) What else besides the default setting of *package* should be added
	  to the set of conventions?  is the ZetaLisp "Syntax:" command adequate?
	  Of course there is *read-base*, but what else?
      (B) Must the editor settle all parsing/syntax related settings before
	  even "loading" in the file ?  or can it wait until a READ operation
	  is applied to some part of the buffer?  a "lazy" parsing.
      (C) What are reasonable conventions for scoping a database configuration?
	  Is a file the appropriate scope?   What about streams that arent files?

(B): In our editor, "loading" in a file applies READ operations to parts of it.
How else is it supposed to know what functions are defined in the file?
The READ operation used is of course parameterized by the language and dialect
the file is written in, along with language-dependent parameters such as the

    Regarding (B), one may well ask why a line like
    is any more mysterious to a default-context parser than the line
    ;;; Package: FOO

I explained earlier that some editors, such as ours, need to support
multiple languages.  Not all languages have the same syntax for
statements in the language itself (clearly!), but every language that
we've heard of has comments and the same syntax of file attribute line
(the line with the -*-) can be used inside the comments of every
language that we've heard of.

To give a concrete example of the issues: of the three dialects of Lisp
we support, only one contains a function named IN-PACKAGE.

    Dill seemed to be asking this question in his note last week; one needn't
    think that the former line has to be subjected to READ any more than the
    latter one.  But the more lispy looking line *can* be interpreted by
    the simple-minded read-eval-print loaded.

It would be possible to make an editor that understands package
specifications in some clearly defined syntax besides the clearly
defined syntax of the file attribute line, and looks for that syntax if
it doesn't find a file attribute line.  Common Lisp does not begin to
specify such a syntax, it merely suggests (p.182) that "all of the
package setup forms appear near the start of the file."  I'm not
interested in spending my limited energies making this specification
concrete enough that it could be useful to a program, but perhaps others