in reply to Re^2: random variable declaration based on given count
in thread random variable declaration based on given count
"As a matter of fact, I wonder where newcomers come up with the tendency to gravitate toward symbolic references. They're not a part of the languages I grew up with such as ..."
Given that a large proportion of these sort of questions seem to have declarations like:
my ($var0, $var1, ..., $varN);
I wonder if this is the result of learning array emulation in languages that don't support arrays.
Here's a rather contrived Bourne shell (circa 1978) example:
$ for i in 0 1 N; do eval var$i=x$i; done; echo "$var0 $var1 $varN" x0 x1 xN
I've encountered more recent scripting languages (i.e. from this millenium) which don't support arrays and emulate them in much the same way by tagging a number (index) onto a base variable name.
-- Ken
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: random variable declaration based on given count
by davido (Cardinal) on Mar 26, 2014 at 19:21 UTC |