On Aug 16, 4:48 am, Nadeem <[EMAIL PROTECTED]> wrote:
> I understand the 99% rule... the example I gave was to simplify the
> issue. The full thing I'm working on is a library for an introductory
> CS class I'm teaching. I'm trying, essentially, to build a library of
> macros for students to use allowing them to define records (like
> structs in C) with selector functions.

The namedtuple recipe by Raymond Hetting does
exactly that and, guess what, it uses exec!
Also the doctest module in the standard library
uses exec at good effect. So, I would say it is
not a 99% rule, let's say it is a 98% rule ;)
BTW, I also write a paper on namedtuple which I
am going to translate in English soon or later
(for the moment there is Google Translator):
http://stacktrace.it/articoli/2008/05/gestione-dei-record-python-1/
The paper, just as the namedtuple recipe,
has a strong functional bias so it may be of interest
to people coming from Scheme.

   Michele Simionato
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to