Bug 4382 – Same syntax to access items of Proxy and Tuple and more

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2010-06-24T04:10:00Z
Last change time
2010-09-20T04:48:55Z
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2010-06-24T04:10:44Z
std.range.Proxy uses .at!(i) to access items, while std.typecons.Tuple uses .field[i] to access items. Is it possible for them to use the same syntax&name to access single items? (A more general comment about the situation: Zip yields Proxies, this is probably done for efficiency, but makes Zip itself less standard. If Zip yields Tuples instead this allows people to use it in a more standard way. To maximize interoperability D2 needs to standardize more its usage of Tuples. A possibility is to move the Proxy struct to std.typecons and consider both Tuple and Proxy the two standard ways to create tuples in D2.)
Comment #1 by dsimcha — 2010-08-14T18:54:40Z
Zip yields proxies because it needs to support accessing stuff by reference and there's no such thing as a ref tuple right now. Proxy contains pointers, not values.
Comment #2 by bearophile_hugs — 2010-09-08T11:10:14Z