Re: Re: Function memoization

Dimitre Novatchev <[email protected]>
Newsgroups gmane.text.xml.xslt.extensions
Message-ID <[email protected]>
>     Dimitre> I have discussed this problem with Michael Kay before. A
>     Dimitre> compromise we agreed upon was not to memorize every
>     Dimitre> sequence-argument but just the ID of
>     Dimitre> the sequence.
> 
> What do you mean by the ID?


I realize that this is implementation-dependent, but it is practical not
to pass long sequences by value. Instead, they can be passed by reference.
The reference is what I was referring to as the "ID" of the sequence.

Cheers,
Dimitre Novatchev

--- Colin Paul Adams <[email protected]> wrote:

> >>>>> "Dimitre" == Dimitre Novatchev <[email protected]> writes:
> 
>     Dimitre> Subject: Re: Function memoization To:
>     Dimitre> [email protected]
> 
>     >> If the function is called again with the same values for the
>     >> arguments, it MUST return the remembered result.  It MUST NOT
>     >> re-execute the function body, as this can cause different
>     >> results in some cases.
> 
>     Dimitre> We must define well what "the same values for the
>     Dimitre> arguments" means.
> 
>     Dimitre> It is impractical to remember and compare long sequences
>     Dimitre> -- this may require excessive amounts of memory and may
>     Dimitre> lead to slower execution than without any memoisation.
> 
> 
>     Dimitre> I have discussed this problem with Michael Kay before. A
>     Dimitre> compromise we agreed upon was not to memorize every
>     Dimitre> sequence-argument but just the ID of
>     Dimitre> the sequence.
> 
> What do you mean by the ID?
> 
> 
> -- 
> Colin Adams
> Preston Lancashire
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.