Re: A side-effect example

/ Alessandro Vernet <avernet@orbeon.com> was heard to say:
| 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".

I think it boils down to "produces the same results as an
implementation known to be conformant". This moves the whole caching
issue off to a quality of implementation consideration.

| 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.

Ah. I think from our perspective, a function like get-url returns a
document. How it does that is irrelevant.

                                        Be seeing you,
                                          norm

-- 
Norman Walsh
XML Standards Architect
Sun Microsystems, Inc.

Received on Thursday, 27 April 2006 10:24:35 UTC