N
Nikolai Weibull
Lately I've found myself using pseudo-anonymous variables a lot, e.g.,
something like this:
[[1, 2], [2, 3], [3, 4]].each{ |first, _| fs << first }
The idea is that I'm not interested in the second part of the internal
arrays, only the first. The lowline works, but obviously for one
parameter, as it is a valid identifier. I was thinking whether Ruby 2.0
should introduce I-don't-care-type variables, like Haskell or Prolog
has. It would make all identifiers beginning with a lowline invalid,
except in parameter-lists, which could mean too much incompatability
with Ruby 1.x, but perhaps it's worth at least some thought?,
nikolai
something like this:
[[1, 2], [2, 3], [3, 4]].each{ |first, _| fs << first }
The idea is that I'm not interested in the second part of the internal
arrays, only the first. The lowline works, but obviously for one
parameter, as it is a valid identifier. I was thinking whether Ruby 2.0
should introduce I-don't-care-type variables, like Haskell or Prolog
has. It would make all identifiers beginning with a lowline invalid,
except in parameter-lists, which could mean too much incompatability
with Ruby 1.x, but perhaps it's worth at least some thought?,
nikolai