Eval only in homeopathic dosage (was: turning a string into an object name)

Nils Goesche ngo at cartan.de
Thu Apr 4 18:53:04 EST 2002


claird at starbase.neosoft.com (Cameron Laird) writes:

> In article <MPG.17165ec2e3c10c6c98969a at news.nwlink.com>,
> Jeff Shannon  <jeff at ccvcorp.com> wrote:

> >If you have numerous objects that are conceptually similar, so 
> >that it makes sense to name them sequentially, then you *really* 
> >want to put them in a list or dictionary instead.
> >
> >The same thing is true of almost *every* use of exec or eval() -- 
> >it seems handy, but if you look for it, there's a better solution 
> >to your real problem.

> Of course.
> 
> The question I have is this:  do the (Common, let's say)
> Lispers agree yet?  Their usual response to lots of situ-
> ations is that Lisp has hygienic macros, and that makes

Lisp is not Scheme.  There is DEFMACRO, though...

> all the difference in the world.  Well, yeah, Lisp's 
> great for definition of Little Languages, which are
> always inherently desirable.  On the other hand, intro-
> spective fiddling is always, *always* tricky, and never
> helps maintenance of (end-user) applications.  We pro-
> pellorheads lust for it, and of course it's crucial in
> small doses, but it's simply a hazard beyond one or 
> two molecules per program.
> 
> I'll make this concrete:  what's a modern example of 
> use of a hygienic macro in an end-user application
> that wouldn't truly be better off as a dictionary or
> related data structure?

I am not sure I get what you mean.  How would you replace, say,
the WITH-OPEN-FILE or DEFCLASS macro by a dictionary?

Regards,
-- 
Nils Goesche
Ask not for whom the <CONTROL-G> tolls.

PGP key ID #xC66D6E6F



More information about the Python-list mailing list