Re: Include 04 export/import

"Aaron Stone" <aaron@serendipity.cx> Wed, 14 June 2006 23:13 UTC

Received: from balder-227.proper.com (localhost [127.0.0.1]) by balder-227.proper.com (8.13.5/8.13.5) with ESMTP id k5END37G078632; Wed, 14 Jun 2006 16:13:03 -0700 (MST) (envelope-from owner-ietf-mta-filters@mail.imc.org)
Received: (from majordom@localhost) by balder-227.proper.com (8.13.5/8.13.5/Submit) id k5END3wO078628; Wed, 14 Jun 2006 16:13:03 -0700 (MST) (envelope-from owner-ietf-mta-filters@mail.imc.org)
X-Authentication-Warning: balder-227.proper.com: majordom set sender to owner-ietf-mta-filters@mail.imc.org using -f
Received: from mail.serendipity.cx (IDENT:r49votbdlxynvykalsim@serendipity.palo-alto.ca.us [66.92.2.87]) by balder-227.proper.com (8.13.5/8.13.5) with ESMTP id k5END281078616 for <ietf-mta-filters@imc.org>; Wed, 14 Jun 2006 16:13:02 -0700 (MST) (envelope-from aaron@serendipity.cx)
Received: from serendipity.palo-alto.ca.us (localhost [127.0.0.1]) by mail.serendipity.cx (Postfix) with SMTP id E0E3E6016D1D; Wed, 14 Jun 2006 16:13:01 -0700 (PDT)
Date: Wed, 14 Jun 2006 23:13:01 -0000
To: Kjetil Torgrim Homme <kjetilho@ifi.uio.no>
Subject: Re: Include 04 export/import
From: Aaron Stone <aaron@serendipity.cx>
X-Mailer: TWIG 2.8.2
Message-ID: <twig.1150326781.63306@serendipity.palo-alto.ca.us>
In-Reply-To: <1150323154.16538.34.camel@mattugur.ifi.uio.no>
References: <1150302510.17583.122.camel@localhost>, <1150302510.17583.122.camel@localhost>
Cc: ietf-mta-filters <ietf-mta-filters@imc.org>
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 Wed, Jun 14, 2006, Kjetil Torgrim Homme <kjetilho@ifi.uio.no> said:

> [VARIABLES] says:
> 
>     Unknown variables are replaced by the empty string.
> 
> it's not an error.

Thanks, I was looking for that reference. I grepped for "undefined" and
"undeclared" and "unset" -- "unknown" was not the word I expected :-P

>> An included script could pull in more variables than were exported, and
>> simply find that some of them are not defined. For example, a :global
>> script might have some documented functionality like, "export ${this}
>> for some useful behavior, and ${that} for some other useful stuff." A
>> user might only set ${that}, but the script has imported both ${this}
>> and ${that}. I don't think it should cause an error.
> 
> I agree.
> 
>    If an "import" command lists a variable that has not been exported
>    and set by any other script at that point during the SIEVE execution
>    process, then an error MUST occur.
> 
> I suggest that "and set" is removed.  remember that changes made to the
> imported variable will be visible in the parent.  this is how values are
> returned from "calling" sub-scripts, and it would be strange to require
> the parent to set it prior to the call.  this should probably made clear
> in the draft.

Would a read-only modified be useful here? For example:

    export :readonly "testvar"

Also, would you still want to consider it an error to import a variable
that was not already exported? I'm on the fence about this.

Aaron