RE : Re: [exslt] Re: Function memoization
by Florent Georges other posts by this author
Jul 14 2006 1:25AM messages near this date
Re: [exslt] Re: Function memoization
|
[exslt] http://www.exslt.com/dev/wiki exslt dev relaunched
& XSLT Colin Paul Adams wrote:
> >>>>> "Dimitre" == Dimitre Novatchev <dnovatchev@[...].com> writes:
> >> What do you mean by the ID?
> Dimitre> I realize that this is implementation-dependent, but it
> Dimitre> is practical not to pass long sequences by
> Dimitre> value. Instead, they can be passed by reference. The
> Dimitre> reference is what I was referring to as the "ID" of the
> Dimitre> sequence.
When I saw that, I understood by "ID" the "identity". Not
an "identity number" or something else too technical, but
the concept of "identity". Without saying how to implement
that, the argument is considered equal if it is "the same".
But...:
> This is no good. That means two functions calls that pass
> the value 3 will not (usually) be memoized.
Maybe it would make sense to say:
- if the argument is an atomic item (or a sequence of 1
such item, as these are indistinguishable), compare by
value (string() or data()?);
- if the argument is a node, compare with the "is"
operator;
- else (so if it is a sequence of at least 2 items),
compare by identity (the two sequences must be the
same one). I think such a "sequence identity" doesn't
exist in the CRs.
> Now if long strings are being passed as arguments, then
> indeed the cost of recognizinf them may be less than the
> cost of running a small function.
This is the /raison d'être/ of this extension. The
implementation doesn't have to guess itself where to use
memoization, the developer will tell it that.
Does it make sense?
Regards,
--drkm
___________________________________________________________________________
Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son interface révolut
ionnaire.
http://fr.mail.yahoo.com
_______________________________________________
exslt mailing list
list@[...].org
http://www.exslt.org/list
Thread:
Dimitre Novatchev
Colin Paul Adams
Dimitre Novatchev
Dimitre Novatchev
Colin Paul Adams
Florent Georges
James Fuller
Colin Paul Adams
Florent Georges
Dimitre Novatchev
Florent Georges
Dimitre Novatchev
Florent Georges
Dimitre Novatchev
Colin Paul Adams
Frans Englich
Florent Georges
|