TDPL reaches Thermopylae level
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Tue Oct 27 10:32:51 PDT 2009
Bill Baxter wrote:
> On Tue, Oct 27, 2009 at 6:56 AM, Michel Fortin
> <michel.fortin at michelf.com> wrote:
>> On 2009-10-27 09:07:06 -0400, Andrei Alexandrescu
>> <SeeWebsiteForEmail at erdani.org> said:
>>
>>> My current thought is to ascribe lhs ~ rhs the same type as lhs (thereby
>>> making ~ consistent with ~= by making lhs ~= rhs same as lhs = lhs ~ rhs) in
>>> case lhs is a string type. If lhs is a character type, the result type is
>>> obviously the same as rhs.
>> Seems the most intuitive option to me. Also, it makes "a ~= b" equivalent to
>> "a = a ~ b" which is always nice.
>
> And that kind of suggests to me that even a = b should work.
> It has many of the same characteristics as ~=. It's pretty
> unambiguous what you'd expect to happen if not an error.
I agree. This one, however, will be very difficult to slide by Walter's
watchful eye. He doesn't like hidden allocations, and a width adjustment
does involve one.
Andrei
P.S. I got green light from my editor's marketing folks. Will release
The Thermopylae Excerpt of TDPL today for free off my website. Stay
tuned. It's a rough draft but I hope you will enjoy it.
More information about the Digitalmars-d
mailing list