DMD 1.039 and 2.023 releases

Nick Sabalausky a at a.a
Sat Jan 17 08:47:54 PST 2009


"Michel Fortin" <michel.fortin at michelf.com> wrote in message 
news:gksbop$2ttr$1 at digitalmars.com...
> On 2009-01-16 22:17:57 -0500, Daniel Keep <daniel.keep.lists at gmail.com> 
> said:
>
>> The '#' has a nice connotation for anyone who's used to C/C++, given
>> that those statements are handled at "compile time."  The problem, of
>> course, is that they're really nothing like C preprocessor statements.
>> They have a different syntax, and completely different capabilities.
>> What's more, you can't mix them across statements/expressions, so I
>> suspect it would just cause more confusion.
>>
>> Additionally, there's this:
>>
>>    #endif
>>
>> Unless you plan on moving all control structures to BASIC/pascal style,
>> I don't think it's wise to start mixing them all over the place.
>
> All good reasons, but there is one more:
>
> If you use #if in the standard D language, then it'll make it harder to 
> use a real C preprocessor when you need it. D has support for #line in the 
> language so that the compiler gives you error messages relative to the 
> right included file and line in a preprocessor output. D doesn't have a 
> preprocessor built-in, and doesn't recommand using one either, but it has 
> support for it. Introducing #if in the D language would break that 
> support.
>
>
>> I do like the idea of a "scopeless block" syntax in theory, though it's
>> not something that's really been an issue for me.
>
> Me neither.
>

The only time I've had a problem with any scope/scopeless block issue is 
having gotten bitten once by the inability to use a mixin to declare a scope 
object (since it only lives within the mixin's own implicit scope and not 
the scope where the mixin is instantiated (as I would have expected)...which 
does seem odd now that I think about it, because an "int a", for instance, 
declared inside a mixin still outlives the mixin, even though I don't think 
that happens with an explicit block). But that doesn't really need a special 
"scopeless block" syntax to be fixed. 




More information about the Digitalmars-d-announce mailing list