From: Paul F. Dietz
Subject: LOAD on streams not associated with files
Date: 
Message-ID: <jSSdnfRAm4A5YqijXTWcpg@dls.net>
What is the following form supposed to do:

(with-input-from-string (s "(print 'foo)") (load s))

In CMUCL and SBCL, it prints FOO.

In Allegro CL, it signals an error because the stream S has no
file associated with it (I supposed it needs this to bind
*LOAD-TRUENAME* and *LOAD-PATHNAME*).

	Paul

From: JP Massar
Subject: Re: LOAD on streams not associated with files
Date: 
Message-ID: <3e36e9af.84455175@netnews.attbi.com>
On Mon, 27 Jan 2003 21:57:26 -0600, "Paul F. Dietz" <·····@dls.net>
wrote:

>What is the following form supposed to do:
>
>(with-input-from-string (s "(print 'foo)") (load s))
>
>In CMUCL and SBCL, it prints FOO.
>
>In Allegro CL, it signals an error because the stream S has no
>file associated with it (I supposed it needs this to bind
>*LOAD-TRUENAME* and *LOAD-PATHNAME*).
>
 
On the one hand, it should cause an error, because LOAD says

"loads the file named by filespec into the Lisp environment."

and a FILE is defined as

"file n. a named entry in a file system, having an
implementation-defined nature."

and it seems clear that a string-based stream is not a named
entry in a file system, whatever else it might be.

On the other hand, load says

 "If filespec is a stream, load determines what kind of stream it is
and loads directly from the stream."

which seems to imply possibly different behavior based on the
stream type which might justify being able to LOAD from a
string-stream.

I couldn't fault an implementation for signalling an error.
I would have to say that the behavior is not clearly specified
and as such is implementation dependent.
From: Paul F. Dietz
Subject: Re: LOAD on streams not associated with files
Date: 
Message-ID: <6sGdndU9l477jKqjXTWcqA@dls.net>
JP Massar wrote:

> On the other hand, load says
> 
>  "If filespec is a stream, load determines what kind of stream it is
> and loads directly from the stream."
> 
> which seems to imply possibly different behavior based on the
> stream type which might justify being able to LOAD from a
> string-stream.

Moreover, the type of filespec is 'a stream, or a pathname designator',
and pathname designator already includes 'stream associated with a file'.
So why mention stream again unless it means a stream *not* associated
with a file?

	Paul