assert semantic change proposal
Tofu Ninja via Digitalmars-d
digitalmars-d at puremagic.com
Tue Aug 5 23:28:38 PDT 2014
On Wednesday, 6 August 2014 at 00:52:32 UTC, Walter Bright wrote:
> On 8/3/2014 4:51 PM, Mike Farnsworth wrote:
>> This all seems to have a very simple solution, to use
>> something like: expect()
>
> I see code coming that looks like:
>
> expect(x > 2); // must be true
> assert(x > 2); // check that it is true
>
> All I can think of is, shoot me now :-)
How about something like
@expected assert(x > 2); or @assumed assert(x > 2);
It wouldn't introduce a new keyword, but still introduces the
expected/assumed semantics. You should keep in mind that you
might have to make a compromise, regardless of your feelings on
the subject.
Also, I am going to try to say this in as respectful a way as I
can...
Please stop responding in such a dismissive way, I think it is
already pretty obvious that some are getting frustrated by these
threads. Responding in a dismissive way makes it seem like you
don't take the arguments seriously.
More information about the Digitalmars-d
mailing list