Thread overview | |||||
---|---|---|---|---|---|
|
June 15, 2002 invariant | ||||
---|---|---|---|---|
| ||||
Can invariant be used without the () ? It doesn't seem necessary. invariant() { assert(1 <= day && day <= 31); assert(0 <= hour && hour < 24); } |
June 16, 2002 Re: invariant | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sean L. Palmer | Yes. I never could decide if () should be required, so at the moment they are optional. Note that there are no parameters to invariant's in any case. "Sean L. Palmer" <seanpalmer@earthlink.net> wrote in message news:aegc1o$n0j$1@digitaldaemon.com... > Can invariant be used without the () ? It doesn't seem necessary. > > invariant() > { > assert(1 <= day && day <= 31); > assert(0 <= hour && hour < 24); > } > > > |
June 18, 2002 Re: invariant | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sean L. Palmer | "Sean L. Palmer" <seanpalmer@earthlink.net> wrote in message news:aegc1o$n0j$1@digitaldaemon.com... > Can invariant be used without the () ? It doesn't seem necessary. > > invariant() > { > assert(1 <= day && day <= 31); > assert(0 <= hour && hour < 24); > } Especially compared to unittest without ( ) Since they have/mimic function like behaviour, I would be happy to see ( ) for both. Sandor |
Copyright © 1999-2021 by the D Language Foundation