Re: RE : Re: Re: Function memoization

Colin Paul Adams <[email protected]>
Newsgroups gmane.text.xml.xslt.extensions
Message-ID <[email protected]>
>>>>> "Florent" == Florent Georges <[email protected]> writes:

    Colin> This is no good. That means two functions calls that pass the
    Colin> value 3 will not (usually) be memoized.

    Florent>   Maybe it would make sense to say:

    Florent>     - if the argument is an atomic item (or a sequence of
    Florent> 1 such item, as these are indistinguishable), compare by
    Florent> value (string() or data()?);

Good.

    Florent>     - if the argument is a node, compare with the "is"
    Florent> operator;

Good.

    Florent>     - else (so if it is a sequence of at least 2 items),
    Florent> compare by identity (the two sequences must be the same
    Florent> one).  I think such a "sequence identity" doesn't exist
    Florent> in the CRs.

Re-formulate that as compare each item of the sequence of identity as
determined above.

    Colin> Now if long strings are being passed as arguments, then indeed
    Colin> the cost of recognizinf them may be less than the cost of
    Colin> running a small function.

    Florent>   This is the /raison d'être/ of this extension.  The
    Florent> implementation doesn't have to guess itself where to use
    Florent> memoization, the developer will tell it that.

    Florent>   Does it make sense?

I guess you are right. If the developer makes a bad decision - tough.

It's analogous to xsl:key.





























	

	
		
    Florent> ___________________________________________________________________________
    Florent> Yahoo! Mail réinvente le mail ! Découvrez le
    Florent> nouveau Yahoo! Mail et son interface révolutionnaire.
    Florent> http://fr.mail.yahoo.com


-- 
Colin Adams
Preston Lancashire
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.