March 29

On Friday, 29 March 2024 at 07:21:43 UTC, Walter Bright wrote:

>

You can add unit tests for C code already:

import myccode; // #define cmacro(a) 2

unittest
{
    assert(cmacro(1) == 2);
}

The problem raised in that discussion has to do with things like

#define DOUBLE(x) (x) + (x)
DOUBLE(i++);

The output of DOUBLE isn't the problem, it's the part below it, which you referred to as metaprogramming. You can only test that by running the preprocessor on both lines. Currently, you'd have to create a new C file and add it to your project in order to put it in a unittest.

Now that some time has passed, where I've used this feature with at least 100,000 lines of C code, I'm not as concerned about it.

March 29
On Friday, 29 March 2024 at 07:49:23 UTC, Walter Bright wrote:
> I appreciate the effort you've put into this. But I have to be blunt. I've seen this before. Here's what it looks like in practice:
>
> https://elsmar.com/elsmarqualityforum/media/redneck-car-air-conditioning.1560/

Message received. I won't spend any more time on this going forward.
March 29
On 3/29/2024 2:22 PM, Paul Backus wrote:
> On Friday, 29 March 2024 at 07:49:23 UTC, Walter Bright wrote:
>> I appreciate the effort you've put into this. But I have to be blunt. I've seen this before. Here's what it looks like in practice:
>>
>> https://elsmar.com/elsmarqualityforum/media/redneck-car-air-conditioning.1560/
> 
> Message received. I won't spend any more time on this going forward.

Your time is valuable and I don't want to waste it.
1 2 3
Next ›   Last »