Thread overview
[Issue 23503] Add `lazy with`
Nov 23, 2022
Bolpat
Nov 24, 2022
Bolpat
Dec 17, 2022
Iain Buclaw
November 23, 2022
https://issues.dlang.org/show_bug.cgi?id=23503

Bolpat <qs.il.paperinik@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |qs.il.paperinik@gmail.com

--
November 24, 2022
https://issues.dlang.org/show_bug.cgi?id=23503

--- Comment #1 from Bolpat <qs.il.paperinik@gmail.com> ---
Regular (greedy) `with` is unusable in generic code when the `with`ed type or expression is unknown. Greedy `with` can shadow any local identifier, which ā€“ Iā€™d boldly claim ā€“ is *never* intended.

`lazy with` on the other hand will never make an identifier visible in your scope mean something else. Use-cases in generic code are still rare, but when the `with`ed type or expression is required/expected to provide *some* specific members, it can be used.

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=23503

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P4

--