W3C home > Mailing lists > Public > public-qt-comments@w3.org > June 2008

[Bug 5795] Static Typing: CVS: K2-Steps-2, K2-FunctionProlog-14

From: <bugzilla@wiggum.w3.org>
Date: Thu, 26 Jun 2008 12:23:05 +0000
To: public-qt-comments@w3.org
Message-Id: <E1KBqVF-0000Mn-18@wiggum.w3.org>


--- Comment #8 from Tim Mills <tim@cbcl.co.uk>  2008-06-26 12:23:04 ---

declare function local:something() as xs:integer 


Do you think it is reasonable to return () here without evaluating the

If we redefine the functions as:

declare function local:something() as xs:integer 

do you still think it reasonable?

As I've said before, I think fn:error should have been treated in the way that
exceptions are treated in Haskell, since the error is a side-effect, and the
same goes for updating expressions.

As I'm sure you are aware, the reason fn:error can't be treated as item()* is
that static type checking would end up with type check errors all over the
place.  e.g.

declare function local:maybe-error($arg as xs:boolean) as xs:integer
  if ($arg)
  then fn:error()
  else 1

With fn:error() as 'none', this type checks correctly.  Were it item()*, the
call to fn:error would cause a static type check error.

Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
Received on Thursday, 26 June 2008 12:23:40 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:57:23 UTC