I’m sure this nonexistent feature is not in great demand, but there have
been different times that I (and other people) have wanted it.
This is not a “really serious” proposal, but I wanted to see what other
people’s comments were about lengthy multiple assignments and
how to deal with them.
Sometimes I wish I had an alternative way to do assignment.
Example:
foo, bar, baz, alpha, beta, gamma, fred, bill, joey = *values
In a case like that, my eye has to scan a long way to the right
before finding the equal sign and grasping that this is a multiple
assignment.
I like this better:
vars = [:foo, :bar, :baz, :alpha, :beta, :gamma, :fred, :bill, :joey]
assign values, vars
Note that this wouldn’t be a method call (like alias_method) but
a keyword (like alias) unless “binding of caller” was permitted…
which is another thing I’ve wanted but I suppose will never
happen.
Comments, questions, projectiles?
Hal