Re: Intent of 'declare function ... external'

On Wednesday 01 March 2006 21:06, you wrote:
> Hi Frans,

Hi Jonathan,

Sorry for the late followup.

>
> The binding of an external function is implementation defined. In our
> implementation, DataDirect XQuery, a user can declare static Java
> functions or SQL functions  as external functions, and they can be
> called within an XQuery.

Good examples, I forgot that function signatures can be "dynamically" added to 
the context by 'external' declarations.

[...]

> If the function can not be located, or if there are two functions with
> the same signature, I think the following errors should be raised:

To me it seems like that if the user performs a function call to a 
non-existent function it is clear what errors that leads to, but I don't see 
what says that an 'external' declaration, which specifies an nonexistent 
function, should result in an error.

But you mean that it should silently pass and that it should instead be caught 
when(if!) the user performs the actual function call?

I see advantages in that an implementation is required to issue an error if it 
encounters an 'external' declaration which specifies a function it doesn't 
provide. My point being that whether this compiles is implementation defined:

	declare namespace e = "example.org/An ns which is not supported";
	declare function e:notSupported() external;
	1 eq 1

Or am I wrong?

Also, what is the reason that how reserved namespaces in an 'external' 
declaration are handled, is implementation defined? From what I can tell it 
is implementation defined how for example this query is handled:

	declare function fn:deep-equal(arg as item()*, arg2 as item()*) as xs:boolean 
external;
	1 eq 1


Apologizes in forehand if I built this mail upon misunderstandings.


		Frans

Received on Sunday, 5 March 2006 20:42:09 UTC