From: "Brian Schröder" Date: 2005-07-28T21:13:50+09:00 Subject: Re: Idea for Ruby 2.0 On 28/07/05, Nikolai Weibull wrote: > Brian Schr�der wrote: > > > On 28/07/05, Nikolai Weibull > > wrote: > > > > 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?, > > > Why would it make all identifiers beginning with an underscore > > invalid? One don't care variable should be enough for everybody I > > think ;-). > > > > a, _, b, _, c = *function() > > > > would make sense to me, though > > > > a, _a, b, _b, c = *function() > > > > could continue to set five variables. > > Well, it depends on how you would want it. In Prolog (don't remember > how Haskell does it), all variable beginning with a lowline are ignored > - it adds some documentational value. Perhaps only _ is enough, > nikolai But only for the sake of documentational value it works right now out of the box. Just ignore variables beginning with an _ in your program, and you are done. Or is your aim to optimize the time the assignment takes? regards, Brian -- http://ruby.brian-schroeder.de/ Stringed instrument chords: http://chordlist.brian-schroeder.de/