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

Re: keyword pairs and OPEN

    Date:  5-Oct-82 20:31:36 PDT (Tuesday)
    From: Masinter at PARC-MAXC

    Is the :DIRECTION :PROBE a proper function of "OPEN"? It seems semantically
    quite different; e.g., :BYTE-SIZE, :CHARACTERS etc seem pretty meaningless.
Well, this is a debatable point.  In terms of message passing, a probe stream
has about half the messages that a real-open stream does, and doesn't have any
messages that a real-open stream does not have.  These messages are operations
such as getting and setting attributes of the file.  So you it's reasonable to
think of probing as a subset of opening, or as a separate function.  The Lisp
machine happened to choose the former.
    Tenex/Tops-20 allows for  "give me name of new file"; is that generally useful?
Without actually creating it, how could it be?  If someone else does the same
thing they'll get the same name.  If it does actually create it, is this different
in any way from opening in OUTPUT direction?

    Interlisp separates out the "direction" (ACCESS method) from the
    "recognition mode" in its OPENFILE. (The Interlisp VM is the best
    description of OPENFILE). Thus, an alternative to consider would have
    key words:

    :ACCESS	 - one of :INPUT, :OUTPUT, :APPEND (or ...)
	    no default

    :RECOG - one of :OLD, :NEW, :OLD/NEW (or ...)
	    default depends on :ACCESS

This is just the way it works now in the Lisp machine, and it proved to be
totally hard to understand and use.  Having separate keywords for if-exists
and if-does-not-exist was a good idea on Dan's part, in my opinion.

    :TYPE - one of :TEXT or :BINARY or :DEFAULT (or ...)
	    (default :TEXT)

    :BYTE-SIZE (only meaningful and implies :TYPE :BINARY)

    I'd then fold in the :IF-EXISTS and :IF-DOES-NOT-EXIST with different
    recognition modes.

    What most people then want is some notion of a search-path algorithm on
    recognition mode :INPUT. This sometimes takes the form of hacking with
    the name which is supplied, which perhaps Common Lisp should avoid.

If you mean recognition in the sense of filename completion, that CERTAINLY
does not belong as part of OPEN.  It should be a separate function, but
probably Common Lisp is not prepared to standardize things like this yet.
However, I may not have understood your last paragraph.