[Issue 11929] Disallow `ref` in front tuple expansion in foreach over range

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jan 15 06:24:19 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=11929



--- Comment #2 from Denis Shelomovskij <verylonglogin.reg at gmail.com> 2014-01-15 18:24:11 MSK ---
(In reply to comment #1)
> Are you arguing against ref parameters in for/foreach loop in general?  I see
> no reason for it because the root of the problem is in putting ref (and there
> is no reason for it), so it is PEBKAC.

 Thanks for the sarcasm. Probably I should add more description:

Ranges of tuples generally contains generated somehow based on source ranges
tuples (e.g. `zip` and `group`) so access to tuple elements by `ref` is a
nonsense. As D type system doesn't provide head const I see no way to mark
tuple elements non-`ref`able so I suggest to disallow such access in general as
I'm not aware of cases where such functionality is needed. And even if there
are such cases IHO its support doesn't worth potential confusion.

-- 
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