[Issue 13084] ModuleInfo.opApply delegate expects immutable parameter

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Jul 17 19:10:02 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=13084

--- Comment #24 from Kenji Hara <k.hara.pg at gmail.com> ---
(In reply to Dicebot from comment #23)
> > All D programmers would assume that unqualified type name T is a mutable type, and const(T) is const, immutable(T) is immutable.
> 
> What? Sounds like total nonsense. I use aliases of qualified types all the
> time, it is a very useful tool for enforcing certain qualified semantics.
> Programmers that expect that must have never read the docs.
> 
> I think it is a reasonable solution.

In your code, you can have such aliases. But don't add such alias in standard
library code. It will introduce much limited situation than benefits.

For example, in the proposal original mutable name _ModuleInfo is private and
inaccessible. So if a programmer want to use const ModuleInfo, he should write
it like const(Unqual!ModuleInfo). Why Unqual is necessary? In other words, you
assumes that most D programmers won't use non-immutable ModuleInfo in their
code. I think it's not reasonable assumption.

--


More information about the Digitalmars-d-bugs mailing list