Re: leakproof - Mailing list pgsql-hackers

From Don Baccus
Subject Re: leakproof
Date
Msg-id 696CBD05-0F58-4AE3-B7AA-B23FBD278C51@pacifier.com
Whole thread Raw
In response to Re: leakproof  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: leakproof
List pgsql-hackers
On Feb 19, 2012, at 7:24 PM, Tom Lane wrote:

> Don Baccus <dhogaza@pacifier.com> writes:
>> On Feb 19, 2012, at 5:42 PM, Tom Lane wrote:
>>> Hmm, "pure" doesn't sound bad to me.  Nice and short.
>
>> Technically, "pure" is stronger than "has no side effects":
>> http://en.wikipedia.org/wiki/Pure_function
>> Result can't depend on state (for instance, database contents), either.  This is the typical definition used in
functionalprogramming. 
>
> Well, that condition is subsumed in our idea of an immutable function.

Yes, I said that myself, perhaps you didn't bother to read closely?


> It's not clear to me whether pure/leakproof functions are meant to be a
> strict subset of immutable functions

Superset, not subset, unless my guessing is wrong.  How could "pure" be a subset of "immutable"?

OK, at this point, proponents will explain why ...

But if you're not clear as to what a "leakproof" function is meant to be. then I suggest the definition must be defined
veryclearly, so everyone understands what it is meant to be. 

> , but if they are then they meet
> this stricter definition.  On the other hand, if pure/leakproof functions
> don't have to be immutable but only stable, then the stricter definition
> corresponds to "pure immutable".  That still doesn't sound too bad, as
> long as we define our terms clearly in the docs.

Sure, let those making the proposal make things clear.

Just speaking as a gadfly who's not posted here for probably close on 10 years …


----
Don Baccus
http://donb.photo.net
http://birdnotes.net
http://openacs.org








pgsql-hackers by date:

Previous
From: Greg Smith
Date:
Subject: Re: Future of our regular expression code
Next
From: Jay Levitt
Date:
Subject: Re: Future of our regular expression code