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

Re: XML design of ((a and b) or c)

  • From: Tei <oscar.vives@g...>
  • To: xml-dev@l...
  • Date: Fri, 15 Dec 2006 11:41:40 +0100

Re:  XML design of ((a and b) or c)
On 12/15/06, Rick Marshall <rjm@z...> wrote:
> Hi Ken
>
> The point here is quite subtle and VERY important.
>
> Let's just take "a AND b" or "a & b" to reduce the overloading of the
> word and.
>
> Now if a and b are atomic and & is commutative the the order of
> evaluation is unimportant and optimisers can play around to suit themselves.
>
> However, if a or b are not atomic and the calculation of either has side
> effects then "a & b" is no longer commutative and optimisers cannot stop
> the calculation on detection of a or b being false.
>
> Unless of course we agree to use slightly different mathematics: "a & b"
> is not commutative; it is evaluated left to right; and evaluation stops
> if a is false. This can then be extended to "a & b & c ...".
>
> Now the "a & b" of computer languages is fundamentally different to the
> "a & b" of mathematics although they degenerate to the same thing if a
> and b are atomic.
>

Just to be sure,  &  is different from && on C.

& is the and operation betwen bits, the result is a integer
&& is the and operation betwen booleans, the result is a boolean

0x0F & 0xF0 result to 0
0x0F && 0xF0 result to true

You will not use & for shortcuts, but &&.


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


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
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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.