Project

Profile

Help

Patch #1414

closed

rest argument catch-all for extension functions

Added by Anonymous over 19 years ago. Updated almost 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Internals
Sprint/Milestone:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Legacy ID:
sf-1064964
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:

Description

SourceForge user: gschadow

O.K. here is the final installment to my work on Saxon

8.1.1 extension functions. This allows an extension

function to have a trailing formal argument of type

Expression[]. If that is the case, all remaining actual

arguments are bound to that expression array and can

be evaluated on demand under complete control of the

user function.

This patch depends on the deferred argument evaluation

(special form) patch.

I give an example in Function.java that are

demonstrated in demo/progncond.xsl

progn(expr1, expr2, ...) - fully evaluate all arguments

left to right and return the value of the last argument.

progi(i, expr1, expr2, ...) - fully evaluate all arguments

left to right and return the value of the i-th argument.

cond(c1,r1, c2,r2, ..., cn,rn) - determine the effective

boolean value of the conditions c1, c2, ... left to right

and return the value of the associated result expression

r1 or r2, ... respectively.

The demo shows a lot of the function of the closure

function as well, so the demo does depend on the user

closure function patch, but that is not essential to

demonstrate the work of progn, progi, and cond.

regards,

-Gunther


Files

rest-for-special-form.zip (9.56 KB) rest-for-special-form.zip Anonymous, 2004-11-12 04:35
Actions #1

Updated by Michael Kay almost 11 years ago

  • Status changed from New to Closed

Closed because it's unlikely this still works, it's unlikely anyone uses it, and the requirement is better met using XPath 3.0 higher order functions.

Please register to edit this issue

Also available in: Atom PDF