SHORT Re: Suggestion: "fix" assert(obj)
Bill Baxter
dnewsgroup at billbaxter.com
Sat Jun 16 15:52:45 PDT 2007
Georg Wrede wrote:
> Bill Baxter wrote:
>> Georg Wrede wrote:
>>> Walter Bright wrote:
>>>> Kristian Kilpi wrote:
>>>>> The problem is that
>>>>>
>>>>> assert(obj);
>>>>>
>>>>> does not first check if 'obj' is null.
>>>>
>>>> Yes it does, it's just that the hardware does the check, and
>>>> gives you a seg fault exception if it is null.
>>>
>>> Asserts were INVENTED to *avoid segfaults*.
>>
>> What I find odd is that Walter often argues that things in D that
>> *look* like C++ should *act* like C++ as much as possible.
>
> He should. This is a C family language, designed to woo the C(++) crowd
> out of their misery. So, things that "look" the same, should act
> unsurprisingly. And things that don't act like those folks expect,
> should look something diferent.
Right. I was agreeing with you. My point was that Walter *usually*
advocates "things that look like C should act like C", but in this case
he's going against his own advice. I didn't mean to say that trying to
make C constructs to do the same thing in D was odd.
--bb
More information about the Digitalmars-d
mailing list