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

Re: keyword pairs and OPEN

Is the :DIRECTION :PROBE a proper function of "OPEN"? It seems semantically
quite different; e.g., :BYTE-SIZE, :CHARACTERS etc seem pretty meaningless.
Tenex/Tops-20 allows for  "give me name of new file"; is that generally useful?

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

: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.