thinking again about Roger's original question:
"for-each vs recursive functions"
I think, other than efficeincy reasons for selecting between these two
constructs, designer's select a construct because it's easier for them
to design a specific algorithm (and to realize the design, people
sometimes might go to extents like adding more memory or a faster
CPU).
Moreover, IMHO a code should be written, keeping in view that it will
be seen, and possibly maintained by other people. A recursive
implementation, for a recursive problem, is easily understood by
others!
IMHO, another point.. I generally wouldn't like to write a iterative
implementation (for efficiency benefits), if the computing resources I
have, could easily serve a recursive implementation for a recursive
problem.
To summarize the above thoughts,
efficiency concerns (space & time) and algorithm design, are 'traded
of' for different use-cases.
On Fri, May 7, 2010 at 4:32 AM, Costello, Roger L.
<costello(_at_)mitre(_dot_)org> wrote:
Hi Folks,
1. Everything that can be done using xsl:for-each can be done using a
recursive function. (True or False)
2. There are things that can be done using a recursive function that cannot
be done using xsl:for-each. (True or False)
3. xsl:for-each is syntactic sugar. (True or False)
4. Favor recursive functions over xsl:for-each. (True or False)
/Roger
--
Regards,
Mukul Gandhi
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--