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

Probe-File and proposed extension.



    Date: Mon, 8 Apr 1985  10:23 EST
    From: Rob MacLachlan <RAM@CMU-CS-C.ARPA>


    Query:
	Should Probe-File never signal an error, even if it is given a
    namestring which is malformed?

    Proposal:
	There needs to be some way to determine whether a file name is
    legal for output.  I brought this issue up once before on this mailing
    list, but I think the discussion died.  I am bringing it up again
    because we need something of the sort in Spice Lisp, so I am going to
    implement it.  My proposed solution is the following:  Probe-File
    should take a direction argument, which defaults to :input.  The
    semantics of Probe-File would be to return the pathname which would be
    used if the file was opened in that direction, and to return NIL if
    the open would fail.  

What's wrong with calling OPEN and handling the error when it fails?  Since
I don't understand the desired application, I don't know whether my question
makes sense.

"Common Lisp does not have a standard way to handle errors" is not an acceptable
answer.  It should get one.

			  Secondary query: Should the direction argument
    be a keyword or an optional?  I favor an optional, since I can't think
    of any other arguments that want to be added to Probe-File.

I can think of two other arguments right off the bat; make it a keyword.