[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: common-lisp@su-ai.ARPA
- Subject: probe-file
- From: masinter.pa@Xerox.ARPA
- Date: Thu, 11 Apr 1985 23:27:00 -0000
Probe-file is useful but necessarily heuristic, even for output mode.
(The Interlisp equivalent is called OUTFILEP, and hasn't been flushed.)
Let us suppose a that we had probe-file-that-generates-errors. This is
the one that does the probe-file, but generates errors if the file name
has illegal syntax, the server is down, etc. Lets suppose for a moment
that the error string in the error is always (kind of error: additional
information), e.g. "file server not responding: name-of-server".
Let me define a new function probe-file-without-errors, defined to
return the value of probe-file-that-generates-errors if the latter
returns non-NIL without errors, or else NIL and an optional second
argument, which is the "error code". Lets say that the error code is a
list of strings.
Note that there is some mutual property of these two functions, in that
either is relatively simple to implement in terms of the other, given an
error system of the imagined complexity of the Common Lisp error system.
Which would you prefer to have in the "standard" Common Lisp? Both?
Which would fit well with "most programs"? Which would "most
programmers" naturally chose if they had both available in their
Given that probe-file is, on any machine except stand-alone
single-process systems, a heuristic at best, I'd claim that
probe-file-without-errors is more useful. I would claim that "can't
tell" is also a reasonable "error" code, and that it would be legitimate
(but not particularly useful) for an implementation to always return NIL
to probe-file, with "can't tell" as the reason.