[Top] [All Lists]

Re: Comment on draft-showalter-sieve-02.txt

1997-10-29 08:43:33
Tomas Fasth writes:
it's not a programming language in that sense. But I cannot restrain
myself from giving you an example of exception handling, using the
excellent programming language called Python:

if header ("subject") contains-nocase ("the secret message")
    dwim blurdybloop body
  except ActionNotFound:
    keep # leave it alone

  Wow, I didn't expect to hear Python mentioned here, but that's great
with me!
  I would like to point out that really only the layout and try/except
lines are legal Python.  I'd expect a Python translation to look more

  if string.find(string.lower(header["subject"]), "the secret message") > -1:
    except ActionNotFound:


  I like the idea of exceptions in a "normal" programming language,
but am not convinced that they are appropriate here.  Perhaps all
exception-like conditions should be handled by the implementation as
keep commands; this seems to be in the spirit of the proposal.


Fred L. Drake, Jr.
Corporation for National Research Initiatives
1895 Preston White Drive
Reston, VA    20191-5434

<Prev in Thread] Current Thread [Next in Thread>