[Issue 12347] New: adjoin!SingleFun does not return a tuple
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Mar 11 04:26:41 PDT 2014
https://d.puremagic.com/issues/show_bug.cgi?id=12347
Summary: adjoin!SingleFun does not return a tuple
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: Phobos
AssignedTo: nobody at puremagic.com
ReportedBy: monarchdodra at gmail.com
--- Comment #0 from monarchdodra at gmail.com 2014-03-11 04:26:40 PDT ---
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.
--
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list