Extending basic types - bool

Frits van Bommel fvbommel at REMwOVExCAPSs.nl
Fri Jan 19 08:14:45 PST 2007


%u wrote:
> Frits van Bommel Wrote:
>> The operators !, ., &&, ||, ?:, and a few others will likely never be 
>> overloadable.
> This was set up long before Walter implemented lazy evaluation. Now that D has lazy evaluation it should be easy to make at least &&, || and ?: overloadable. 

It's a bad idea to change the meaning of currently-valid syntax.

> The module .-operator is IMO a misconstruction.

I was mainly referring to the boolean operators listed there: !, &&, || 
and ?:.

> The !-operator as a prefix operator is a solely C-ish-negation; at least I have not seen it anywhere else. Thus there is no need to overload it ever.

There is if you want to make a class/struct that exactly mimics a bool.

> --
> Anonymity is not a Crime

As I commented before, pseudonymity is nicer. Though this sig may be a 
good way to distinguish different "%u"s :). At least, as long as only 
one person uses it.


More information about the Digitalmars-d-learn mailing list