[ZPT] CVS: Packages/TAL - README.txt:1.14

Evan Simpson evan@digicool.com
Mon, 9 Apr 2001 18:45:36 -0400


From: "Guido van Rossum" <guido@digicool.com>
> Do you want me to provide a function that checks whether a program is
> still valid?  I propose the following API:
>
>     import TALDefs
>
>     TALDefs.isValidProgram((program, macros)) -> Boolean
>
> Note that isValidProgram() takes a single argument that's a tuple of
> (program, macros) -- that way you can pass it the cached output from a
> previous compilation without having to know its structure.

Hmm.  I already pay close attention to its structure, since I expose the
macros separately.  Hey, I just noticed; TALInterpreter doesn't do anything
with the macros argument except hold onto it, right?  Also, a macro is a
valid program in its own right.  So really, this should just accept a single
program.  The macro program will get tested for validity when a use-macro
tries to retreive it.

> This wouldn't be a surefire test, e.g. if you gave it a
> hand-constructed tuple you might have something that passed the test

In that case, the name seems to promise too much.  How about
TALDefs.isCurrentVersion(program)?

Cheers,

Evan @ digicool