harryo / zipworld.com.au (Harry Ohlsen) writes:

> I like this.  However, it got me wondering about how one might modify
> it to make the following work ...
> 
> 	A, B, C, D, E = enum(5)
> 
> or, if one wanted to specify a starting value, something like ...
> 
> 	A, B, C, D, E = enum(5, 123)

  def enum(count, start=1)
    (start...(start+count)).to_a
  end

  a,b,c = enum 3

  d,e,f,g,h = enum 5,120

  a,b,c,d,e,f,g,h #=> 1, 2, 3, 120, 121, 122, 123, 124


Regards


Dave