Re: I-D ACTION:draft-daboo-sieve-include-03.txt (fwd)

"Aaron Stone" <aaron@serendipity.cx> Thu, 25 August 2005 23:58 UTC

Received: from above.proper.com (localhost.vpnc.org [127.0.0.1]) by above.proper.com (8.12.11/8.12.9) with ESMTP id j7PNwmo5068769; Thu, 25 Aug 2005 16:58:48 -0700 (PDT) (envelope-from owner-ietf-mta-filters@mail.imc.org)
Received: (from majordom@localhost) by above.proper.com (8.12.11/8.12.9/Submit) id j7PNwmMY068768; Thu, 25 Aug 2005 16:58:48 -0700 (PDT)
X-Authentication-Warning: above.proper.com: majordom set sender to owner-ietf-mta-filters@mail.imc.org using -f
Received: from lucite.serendipity.cx (IDENT:od25j3hvf3s4sok167h8@serendipity.palo-alto.ca.us [66.92.2.87]) by above.proper.com (8.12.11/8.12.9) with ESMTP id j7PNwlPA068761 for <ietf-mta-filters@imc.org>; Thu, 25 Aug 2005 16:58:47 -0700 (PDT) (envelope-from aaron@serendipity.cx)
Received: by lucite.serendipity.cx (Postfix, from userid 1003) id 8DEFC60A4D1A; Thu, 25 Aug 2005 16:58:47 -0700 (PDT)
Received: from serendipity.palo-alto.ca.us (localhost [127.0.0.1]) by lucite.serendipity.cx (Postfix) with SMTP id 433E56024E30; Thu, 25 Aug 2005 16:58:47 -0700 (PDT)
Date: Thu, 25 Aug 2005 23:58:47 -0000
To: Kjetil Torgrim Homme <kjetilho@ifi.uio.no>, Sieve Mailing List <ietf-mta-filters@imc.org>
Subject: Re: I-D ACTION:draft-daboo-sieve-include-03.txt (fwd)
From: Aaron Stone <aaron@serendipity.cx>
X-Mailer: TWIG 2.8.2
Message-ID: <twig.1125014327.8763@serendipity.palo-alto.ca.us>
X-DSPAM-Result: Innocent
X-DSPAM-Confidence: 0.6000
X-DSPAM-Probability: 0.0023
X-DSPAM-Signature: !DSPAM:430e5b37280911547439528!
Sender: owner-ietf-mta-filters@mail.imc.org
Precedence: bulk
List-Archive: <http://www.imc.org/ietf-mta-filters/mail-archive/>
List-ID: <ietf-mta-filters.imc.org>
List-Unsubscribe: <mailto:ietf-mta-filters-request@imc.org?body=unsubscribe>

On Thu, Aug 25, 2005, Kjetil Torgrim Homme <kjetilho@ifi.uio.no> said:

> On Thu, 2005-08-25 at 15:30 +0000, Aaron Stone wrote:
>> On Thu, Aug 25, 2005, Kjetil Torgrim Homme <kjetilho@ifi.uio.no> said:
>> > "All variables have global scope: they are visible until processing
>> > stops."
>> > 
>> > I find this sufficiently clear to answer "yes" to all three of Cyrus'
>> > questions, but then I wrote it :-)
>> 
>> I wouldn't have gotten that on my own in a million years, neither in
>> implementing a Sieve interpreter nor in writing my own scripts. 
> 
> okay, would you interpret that statement differently, or is it just
> easily overlooked?

Both... it's only a single sentence, and a major issue. I think a section
entitled "Scope" at around 4.2 or 4.1.4 would be best. Also, when the
issue comes up the user or implementor will have the question, "Why does
my variable contain weird values after an include?" or "Why can't I access
a variable set in another file?" and the answer should be explicit to
those questions.

[snip]
> there is only one script, it just so happens that it may consist of more
> than one file :-)

Ok, but that doesn't change my position ;-)

:local would be like C's static applied to a variable in the file.

>> The very presence of a :global and/or :local modifier makes for an
>> explanation that will clarify things for implementors and end users alike.
>> On this point, what do folks think?
> 
> I don't think it is a very important point.  the scripts I see tend to
> use a "stop" as soon as possible, and there is little need to keep state
> across an include statement.  the risk of having your state trampled on
> is small, especially since you'll tend to control all the script
> components yourself.  indeed, I think it would be more common to use a
> global variable set in the included file to return the result to the
> calling file.

Include will allow more sites to create libraries of common scripts. These
scripts will want to keep most of their namespace clean and/or protected.
Prefixed on the variables might work, but a :local / :global mechanism
would make these protections more explicit.

Aaron