Bug 12347 – adjoin!SingleFun does not return a tuple
Status
RESOLVED
Resolution
WONTFIX
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-03-11T04:26:00Z
Last change time
2014-03-15T15:55:27Z
Assigned to
nobody
Creator
monarchdodra
Comments
Comment #0 by monarchdodra — 2014-03-11T04:26:40Z
It simply aliases to SingleFun.
While it sounds like a good idea on paper, in practice, it is actually counter-productive:
In non-generic code, no-one will use adjoin for a single function.
In generic code, it becomes counter productive, since the caller will have to explicitly handle single arg cases, since the result can't be statically indexed or iterated on. This *forces* the user to handle it explicitly in a different branch.
Given the design, we might as well return a tuple: Then the user *may* handle it differently, if he so wishes, but it will still work even without special handling.
Also, it goes against documentation. The documentation states that a tuple is returned.
Comment #1 by peter.alexander.au — 2014-03-15T11:47:59Z
Shall we close this as WONTFIX now? The pull was rejected.
Comment #2 by monarchdodra — 2014-03-15T15:55:27Z
(In reply to comment #1)
> Shall we close this as WONTFIX now? The pull was rejected.
Arguably, it became an ER to change it's documented behavior according to what it's actually doing. Filing that would be work though, so yes, WONTFIX.