Re: choose() function return type

John,

Sorry about that, I am removing www-forms-editor. But at what point
should we consider that an email is a comment for the editor?

You might be right this this could be useful for optimization,
although I would like to see a convincing argument for it.

Further, while it is acceptable for a built-in comparison operator to
specify how types are cast and what result types are produced, I am
not sure that this should be applicable to functions. In other words,
I am not sure that the XPath engine should be allowed to special-case
certain functions and guess their return type beyond looking at the
function's prototype. At least, I have not seen examples of this
beyond built-in operators.

-Erik

John Boyer wrote:
 >
 > Hi Erik,
 >
 > Please send the discussion emails to public-forms (or www-forms) but not
 > www-forms-editor.
 >
 > It's a good point you make.  If I recall correctly here, the feeling was
 > that more efficient code could be written to produce the result if the
 > type of the output could be decided from the types of the inputs.
 >
 > So the discussion here would be to weigh that possible efficiency
 > against the generalization.
 >
 > Cheers,
 > John M. Boyer, Ph.D.
 > STSM: Lotus Forms Architect and Researcher
 > Chair, W3C Forms Working Group
 > Workplace, Portal and Collaboration Software
 > IBM Victoria Software Lab
 > E-Mail: boyerj@ca.ibm.com
 >
 > Blog: http://www.ibm.com/developerworks/blogs/page/JohnBoyer
 >
 >
 >
 >
 > *Erik Bruchez <ebruchez@orbeon.com>*
 > Sent by: www-forms-editor-request@w3.org
 >
 > 07/18/2007 06:46 AM
 > Please respond to
 > ebruchez@orbeon.com
 >
 >
 > 	
 > To
 > 	"Forms WG (new)" <public-forms@w3.org>
 > cc
 > 	www-forms-editor@w3.org
 > Subject
 > 	choose() function return type
 >
 >
 > 	
 >
 >
 >
 >
 >
 >
 > All,
 >
 > In section "7.11.3 The choose() Function", I read:
 >
 >   "If the types of the two object parameters are not the same
 >    (e.g. one node-set and the other a string), then the type of the
 >    object returned is determined by rationalizing the types of the two
 >    object parameters in the same manner as XPath comparison."
 >
 > I am wondering why this needs to be specified at all. As per its
 > prototype, the function returns an object. At runtime, the returned
 > object will be either of the type of the first object parameter if
 > that first object is returned, of the type of the second object
 > parameter if that second object is returned.
 >
 > Am I missing something?
 >
 > -Erik
 >
 > --
 > Orbeon Forms - Web Forms for the Enterprise Done the Right Way
 > http://www.orbeon.com/
 >
 >
 >


-- 
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/

Received on Monday, 23 July 2007 22:24:21 UTC