RE: [xsl] Is this a Saxon 8.0 bug ?

Subject: RE: [xsl] Is this a Saxon 8.0 bug ?
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Mon, 28 Jun 2004 08:32:17 +0100
> Memo functions were invented by Professor Donald Michie of Edinburgh
> University. The idea was further developed by Robin 
> Popplestone in his Pop2
> language long before it was ever worked into LISP.</quote>
> 
> Is this the 'tunnelling effect' that Mike has spoken of previously?
> Whereby params are passed on to called templates without explicit
> specification in the template?
> 

No, tunnel parameters are quite unrelated.

I find it hard to improve on the definition of memo functions that you've
cited. It means that if you write a function to calculate the square root of
two, then if you ever call it again, it doesn't recalculate the result, it
remembers it from last time. Which needs more memory but less compute time.
XSLT 2.0 functions can be memoised because there are no implicit parameters
(e.g. functions can't access the context item) so if you call them twice
with the same arguments, you will always get the same answer - except, as I
mentioned, in the case where the function creates a new node, in which case
calling it twice will give you two nodes rather than one.

Michael Kay


Current Thread