Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^3: random variable declaration based on given count

by kcott (Archbishop)
on Mar 26, 2014 at 17:52 UTC ( [id://1079844]=note: print w/replies, xml ) Need Help??


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

    So the question everyone wants to know now is what language encourages such "symbolic ref" practices, and doesn't have a predictable implicit initialization of variables? Because the original question in this thread seems to be grasping for symbolic refs, and seems to assume that variables not explicitly initialized will be "some random value" (which we know, even for languages such as C, isn't really random).

    This is just a muse out on a tangent, of course. ;)


    Dave

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1079844]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-23 16:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found