Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!rbj From: rbj@uunet.UU.NET (Root Boy Jim) Newsgroups: comp.lang.perl Subject: Re: using contents of a scalar variable as a variable name Message-ID: <129284@uunet.UU.NET> Date: 16 Apr 91 21:04:47 GMT References: <1991Apr13.042043.9023@jpl-devvax.jpl.nasa.gov> <9662@star.cs.vu.nl> <1991Apr16.111348.9627@convex.com> Organization: UUNET Communications Services, Falls Church, VA Lines: 26 In tchrist@convex.COM (Tom Christiansen) writes: ?From the keyboard of gpvos@cs.vu.nl (Gerben 'P' Vos): ?:Also bindings with dbm files? ?:That * stuff sounds awful. ? ?But listen guys, I seriously suggest avoiding *foo notation unless and ?until you're darn sure you know what's going on. Pass-by-name is one of ?the most obscure things in the whole language. Combine that with dynamic ?scoping, put it in the hands of a novice used to C or awk, and you're just ?asking for trouble. I use it, and I'm glad it's there for the efficiency ?tweaks and functionality it gives me, but it's one of the harder things to ?teach, and I usually just get groans out of the audience. I too had trouble with the concept, until I realized that what you're really doing is PASSING THE SYMBOL. Lisp poeple will have no trouble with that, nor will dynamic scoping bother them. Another way to explain it is pretend that the expression "&a = &b" is legal in C (so "&a = &b; a = 1;" sets b to 1), or compare it to the reference mechanism in C++. I used to like C until I rediscovered Lisp. And that's why emacs is so nice, cuz you get to code in Lisp. -- [rbj@uunet 1] stty sane unknown mode: sane