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

Re: Is the semantics of the "or" operator implementat

Subject: Re: Is the semantics of the "or" operator implementation-dependent?
From: "Wolfgang Laun wolfgang.laun@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 16 Sep 2014 13:43:58 -0000
Re:  Is the semantics of the "or" operator  implementat
On 16 September 2014 14:58, Abel Braaksma (Exselt) abel@xxxxxxxxxx <
xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:


> >
> > Is the semantics of the "or" operator implementation-dependent?
> >
>
> No, the semantics not, the order of execution is, however, which means
> that in error-cases, you can have different outcomes between processors.
> This is not different from other languages, in C#, F#, Java, C++ similar
> forms of optimization exist.
>
> Considering '15.7 in the Java Language Specification: Do you have an
actual example/experience of some Java expression (logical "or") where
different outcomes between processors have been observed?



> If you want to deterministically throw an error, use a more predictable
> way of writing. I don't think I have ever come across a C++ style of code
> like this (and even if you see it, it is considered code smell):
>
> return a || functionThrowingException()
>
> Instead, people tend to write:
>
> return a ? a : functionThrowingException()
>

Even so, many a QA would not tolerate the required function.

-W

>
> which is the equivalence of the if-then syntax in XPath.
>
> Cheers,
>
> Abel Braaksma
> Exselt XSLT 3.0 streaming processor
> http://exselt.net

Current Thread

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.