handful and interval

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Sep 3 03:43:02 PDT 2012


On 9/3/12 11:37 AM, Sven Torvinger wrote:
> On Monday, 3 September 2012 at 09:01:37 UTC, Andrei Alexandrescu wrote:
>> On 9/3/12 10:27 AM, Philippe Sigaud wrote:
>>> People here are talking about sets, but does Andrei really have sets in
>>> mind? That has consequences if you want 'in' to return a pointer to a
>>> value.
>>
>> I wanted to define a couple of simple convenience functions. It seems
>> we've headed into a paralysis of analysis.
>>
>> Andrei
>
> I would advocate using, a < x < b, this trivially addresses open/closed
> intervals etc.
>
> I disagree with the porting from other languages argument... comparing
> bool with < > is not a common occurring pattern, and even if there is
> such code in the wild, many coding standards would force the use of ()
> if using such an expression anyway... so the porting issues would be
> minimal.

It's a sensible argument. What about "among"?

Andrei


More information about the Digitalmars-d mailing list