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

Kjetil Torgrim Homme <kjetilho@ifi.uio.no> Thu, 25 August 2005 21:45 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 j7PLjdKV057348; Thu, 25 Aug 2005 14:45:39 -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 j7PLjdWa057347; Thu, 25 Aug 2005 14:45:39 -0700 (PDT)
X-Authentication-Warning: above.proper.com: majordom set sender to owner-ietf-mta-filters@mail.imc.org using -f
Received: from pat.uio.no (IDENT:7411@pat.uio.no [129.240.130.16]) by above.proper.com (8.12.11/8.12.9) with ESMTP id j7PLjbw4057339 for <ietf-mta-filters@imc.org>; Thu, 25 Aug 2005 14:45:38 -0700 (PDT) (envelope-from kjetilho@ifi.uio.no)
Received: from mail-mx2.uio.no ([129.240.10.30]) by pat.uio.no with esmtp (Exim 4.43) id 1E8PXP-00063k-IM; Thu, 25 Aug 2005 23:45:31 +0200
Received: from 250.80-203-78.nextgentel.com ([80.203.78.250] helo=chico.njus.no) by mail-mx2.uio.no with esmtpsa (TLSv1:RC4-MD5:128) (Exim 4.43) id 1E8PXE-00048W-03; Thu, 25 Aug 2005 23:45:20 +0200
Subject: Re: I-D ACTION:draft-daboo-sieve-include-03.txt (fwd)
From: Kjetil Torgrim Homme <kjetilho@ifi.uio.no>
To: Aaron Stone <aaron@serendipity.cx>
Cc: Cyrus Daboo <daboo@isamet.com>, Sieve Mailing List <ietf-mta-filters@imc.org>
In-Reply-To: <twig.1124983804.70370@serendipity.palo-alto.ca.us>
References: <twig.1124935195.17323@serendipity.palo-alto.ca.us> , <twig.1124935195.17323@serendipity.palo-alto.ca.us> <twig.1124983804.70370@serendipity.palo-alto.ca.us>
Content-Type: text/plain
Date: Thu, 25 Aug 2005 23:45:10 +0200
Message-Id: <1125006310.15136.84.camel@chico.njus.no>
Mime-Version: 1.0
X-Mailer: Evolution 2.2.3 (2.2.3-2.fc4)
Content-Transfer-Encoding: 7bit
X-UiO-Spam-info: not spam, SpamAssassin (score=-3.74, required 12, autolearn=disabled, AWL 1.07, FORGED_RCVD_HELO 0.05, RCVD_IN_SORBS_DUL 0.14, UIO_MAIL_IS_INTERNAL -5.00)
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, 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?

> > [:global] would be a no-op, but a :local modifier is definitely possible if
> > needed.
> 
> It would only be a no-op if the default namespace is the global namespace
> ;-) Unless you guys are already deeply along the path of a single
> namespace, I believe a per-file namespace is less likely to cause
> confusing results.

I personally find a global namespace to be the less confusing option.
cutting the script into pieces and including those from a master file
shouldn't change its meaning, IMHO.  (you'll usually need to duplicate
require statements, though.)

> A :local modifier would do the trick. The text in the drafts should be
> more explicit about there being a single global namespace for all scripts.

there is only one script, it just so happens that it may consist of more
than one 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.
-- 
Kjetil T.