Re: A side-effect example

On 4/26/06, Norman Walsh <Norman.Walsh@sun.com> wrote:
> Indeed. That's the sort of reasoning that lead me to make the proposal
> that I made in response to Alex M.:
>
> We've had two telcons of discussion about how to expose this
> information and we don't seem to be approaching consensus, so let's
> try a new approach.
>
> I propose that we say that all components are non-functional. That is,
> a pipeline implementation must behave as if it evaluated a component
> every time it occurs [in the context of this message, everytime it is
> used in a step]. "Must behave as if" is spec-ease for "implementations
> that are clever enough to determine with certainty that a component
> is, in fact, functional are free to cache the intermediate results
> because by golly if it is, no one will be able to tell."
>
> Pipeline authors who are concerned about controlling the number of
> times a component is executed can use the 'tee' component to split
> output and thereby be confident that it will be evaluated only once.

Norm,

I wholeheartedly agree with this.

I am not sure however how we want to define the notion of "no one will
be able to tell". Say you have a component "get-url" that retrieves a
document from a URL, and that you write a pipeline with two steps:

d1 = get-url("http://feeds.feedburner.com/xml-web-apps")
d2 = get-url("http://feeds.feedburner.com/xml-web-apps")

When d1 is read, the whole XML document is pulled down from the
server. When the second step runs, it might be reasonable to sent an
HTTP request with the "If-Modified-Since" header, to which the server
might reply with "HTTP/1.1 304 Not Modified". So in fact, someone
monitoring the HTTP traffic will be able to tell the difference.

Alex
--
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/

Received on Wednesday, 26 April 2006 23:21:28 UTC