Re: Extension candidates

Florent Georges <[email protected]> Mon, 15 Dec 2008 01:02:07 +0100 (CET)
Newsgroups gmane.text.xml.xslt.extensions
Message-ID <[email protected]>
Dimitre Novatchev wrote:

>     sum($ref)

> $ref is expected to be of type xx:numeric*. It isn't, so a deref()
> takes place and thransforms the expression to:

>   sum(1,2)

> and then this is evaluated to the correct result: 3

> I think this principle is quite clear:

> "dereferencing should take place whenever an item of a particula
> type is expected (such as xs:double), but the argument is a ref. "

> > I think (de)referencing should be explicit.  The point is to be
> > able to manipulate complex structures, so I think exposing
> > explicitly the structure is a feature, not a bug.

> It could be explixit and nobody could stop a programmer from doing
> so.  However it can also be performed behind the scenes as per the
> above simple rule.

  Ok, I think I see what you mean.  There is on the one hand the
reference mechanism (referencing return an item of a specific type
that is able to be dereferenced) and on the other hand the following
rule: "the processor will recover of a typing error by using
dereferencing when this is possible."

  I think the best would be to first specify the reference mechanism
itself, and make the rule an additional feature.  That is a lot of
work I think to specify exactly under what rules recovering must take
place, can take place, must not take place, discover and treat the
ambiguities, etc.

  This rule is quite ambitious and I am not sure it is really possible
to implement it as an extension, but that's interesting!

  Regards,

-- 
Florent Georges
http://www.fgeorges.org/