On 11/14/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > -------- Original Message --------
> > Subject: Re: [sqlite] optimizing out function calls
> > From: Jay Sprenkle <[EMAIL PROTECTED]>
> > Date: Mon, November 14, 2005 4:34 pm
> > To: sqlite-users@sqlite.org
> >
> > > - the random function in C has no arguments, it will produce
> > >   a different result on every call (within the limits of the
> > >   random number generator that is used). Of course from a
> > >   mathematical point of view this is a monstrosity ;).

A monstrosity? Isn't that a bit emotionally over the top?

A random number generator should generate random numbers and
they aren't supposed to be the same. It does generate the same
sequence of numbers each time given the same seed so it's testable.


>
> But 'random' is not a mathematical function. In software we often use
> functions to get values from the outside world ( getch(),time() etc,
> etc). Random is a function which fetches the next number from a random
> number generator. The qualities of that random number depend on the
> underlying generator. When we pass an argument to random it is just to
> control the behaviour of the random number generator.
>
> We would not expect getch() and time() to return the same result each
> time they are called (except on friday afternoons).

I think that's why DRH doesn't cache results for user defined functions.

Reply via email to