Subject: Re: (open :direction :probe ...) vs probe-file
From: Erik Naggum <erik@naggum.no>
Date: 24 Jan 2004 10:34:25 +0000
Newsgroups: comp.lang.lisp
Message-ID: <3283929265717785KL2065E@naggum.no>

* Peter Seibel
| Unless I've missed something, there's not a lot of difference between
| (open file :direction :probe) and (probe-file file).

  Is «file» here intended to be «pathname»?  Note that both OPEN and
  PROBE-FILE accept pathname designators, not just pathnames.  Also,
  they differ remarkably in the type of the return value.

| Do folks have particular stylistic preferences?

  The two functions perform very different functions.  The intersection
  is actually rather uninteresting.  For instance, you may supply OPEN
  with :IF-DOES-NOT-EXIST.  OPEN returns a stream with a specified
  element-type that you should expect to be honored if you pass the same
  stream to a later OPEN call.  (Not that this expectation is satisfied
  everywhere, but at least you can provide the argument explicitly with
  :element-type (stream-element-type <stream>).)

| (Or have I missed some distinction?)

  I wonder if you are fully aware of the factors you chose to ignore in
  order to believe they are so similar.

-- 
Erik Naggum | Oslo, Norway

Act from reason, and failure makes you rethink and study harder.
Act from faith, and failure makes you blame someone and push harder.