[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Static type-checker

Subject: RE: Static type-checker
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Fri, 18 Nov 2005 15:36:29 -0000
appel kay learning to type
It's doable, but not trivial. For example, in XSLT a circularity among
variables is a dynamic error rather than a static error. It's not a static
error to write

<xsl:variable name="x" select="$y/abc"/>
<xsl:variable name="y" select="$x/abc"/>

So static type checking that follows a chain of variable references would
need to look out for circularities.

Also, if one did such inferencing for variables, people would also expect it
to be done for functions. Functions are often recursive, in which case such
inferencing doesn't work.

One also has to be careful not to be too aggressive in type inferencing,
particularly with this situation where the expression is "void" (guaranteed
to return nothing) rather than actually being erroneous. I'm going to take
it cautiously to take advantage of user feedback as it comes.

Michael Kay
http://www.saxonica.com/

> -----Original Message-----
> From: drkm [mailto:darkman_spam@xxxxxxxx]
> Sent: 18 November 2005 14:44
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: RE:  Static type-checker
>
> Michael Kay wrote:
>
>   [ in addition to my previous reply, that
>     I sent to quickly, sorry ]
>
> > Saxon will infer a type for the variable from
> > the select expression if it can do so without
> > contextual analysis, but it won't go chasing
> > around the houses to do it.
>
>   Indeed.  But I think this case is intresting because it's
> simple and,
> IMHO, entirely determinitic.  We have (in the variable's '@select') an
> XPath expression like "$other/child/subchild", whose we know the type
> of the variable "$other" (with its '@as'), and all the possible
> children of "$other" are well known, as well as their types.
>
>   I think it could be not so difficult to infer the type of the new
> variable.  But I don't know enough all the aspects of the problem.  Is
> there some complexity I don't see?  (I'm just curious)
>
>   Thanks,
>
> --drkm
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> ______________________________________________________________
> _____________
> Appel audio GRATUIT partout dans le monde avec le nouveau
> Yahoo! Messenger
> Tilichargez cette version sur http://fr.messenger.yahoo.com

Current Thread
  • RE: Static type-checker, (continued)
    • drkm - 18 Nov 2005 11:47:27 -0000
    • drkm - 18 Nov 2005 14:26:02 -0000
    • drkm - 18 Nov 2005 14:44:25 -0000
      • Michael Kay - 18 Nov 2005 15:36:46 -0000 <=
    • drkm - 18 Nov 2005 16:09:54 -0000

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.