Thread overview | ||||||
---|---|---|---|---|---|---|
|
February 06, 2003 bug ( |= ) | ||||
---|---|---|---|---|
| ||||
This: bit b; ... b|=(x==y); produces this: Internal error: ..\ztc\glopp.c 1619 But if I change it to: b=b|(x==y); it says 'cannot implicitly convert int to bit', so I had to do this: b=cast(bit)(b|(x==y)); I think it's kind of weird. Just in case, I prefer to use bits for booleans. ------------------------- Carlos Santander --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.449 / Virus Database: 251 - Release Date: 2003-01-27 |
February 06, 2003 Re: bug ( |= ) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Carlos Santander B. | Carlos Santander B. wrote: > This: > > bit b; > ... > b|=(x==y); > > produces this: > > Internal error: ..\ztc\glopp.c 1619 It shouldn't produce an error, but it's invalid code: "bit" is not an integer type. > But if I change it to: > > b=b|(x==y); Use "b=b||(x==y);". |
February 06, 2003 Re: bug ( |= ) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Burton Radons | There is a difference between b|c and b||c b|c should always be eval'ed. ( a|b|c) (should not produce jumps) ( a || b || c ) should ! "Burton Radons" <loth@users.sourceforge.net> wrote in message news:b1squn$131j$1@digitaldaemon.com... > Carlos Santander B. wrote: > > This: > > > > bit b; > > ... > > b|=(x==y); > > > > produces this: > > > > Internal error: ..\ztc\glopp.c 1619 > > It shouldn't produce an error, but it's invalid code: "bit" is not an integer type. > > > But if I change it to: > > > > b=b|(x==y); > > Use "b=b||(x==y);". > |
February 06, 2003 Re: bug ( |= ) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mike Wynn | Mike Wynn wrote:
> There is a difference between
>
> b|c and b||c
>
> b|c should always be eval'ed.
> ( a|b|c) (should not produce jumps)
> ( a || b || c ) should !
C 101 time eh. || is also a sequence point, so "a ++ || a ++" has a defined result. But it has nothing to do with Carlos' code.
|
Copyright © 1999-2021 by the D Language Foundation