Why does `filterBidirectional` exist, and why isn't it called `filter`?
Tejas
notrealemail at gmail.com
Sun Mar 12 10:06:00 UTC 2023
On Saturday, 11 March 2023 at 19:52:06 UTC, Timon Gehr wrote:
> On 3/10/23 23:47, Paul Backus wrote:
>> On Friday, 10 March 2023 at 13:46:03 UTC, Ogi wrote:
>>> On Thursday, 9 March 2023 at 17:07:40 UTC, Paul Backus wrote:
>>>>
>>>> I think probably you have to go on a case-by-case basis.
>>>> `File.byLine`, for example, does not and should not
>>>> precompute `front`, because doing so is potentially very
>>>> expensive.
>>>
>>> And then ‘File.byLine’ ends up being const and now you can’t
>>> call ‘front’ on it. Ouch.
>>
>> Ranges already don't work with `const`, so the fact that this
>> one fails to work with `const` a little more than usual is not
>> a huge deal, IMO.
>
> `const` tends to just not work really well together with
> abstraction.
> "`const` correctness" in D is a fool's errand.
Should we just remove `const` then and get it over with?
More information about the Digitalmars-d
mailing list