graydon/rust — Issue #1398: Allow tuples and other irrefutable patterns in parameter specifications
Author: nikomatsakis
Created: 2011-12-30 19:03:52+00:00
State: open

Currently we can write

for (a, b) in vec::zip(as, bs) { ... }

but not

vec::iter(vec::zip(as, bs)) { |(a, b)| ... }

nor

fn proc((a: A, b: B)) { ... }
vec::iter(vec::zip(as, bs), proc)

It would be nice to have these irrefutable patterns work in parameter specifications, if not in all functions then at least in Ruby-like blocks.