[Top] [All Lists]

Re: Draft for script 'include' capability

2003-04-13 20:20:35

[Cyrus Daboo]:

  Below are details for a new draft that I just posted that
  describes a script 'include' capability for including one script
  inside another. I suspect this will be somewhat
  controversial. Obviously this has relevance to the current
  discussion on variables, in particular with regard to scoping. All
  comments welcome...

  A URL for this Internet-Draft is:

thanks.  I think it looks good.  the only thing I don't like is
encoding private vs. global through the included filename.  (one of
the examples omits the directory prefix, btw.)

I prefer
  include :global "spam-tests";
  include "/global/spam-tests";

the default should be to look in the personal folder.

| 4 Open Issues:
|     1   Should we allow URIs to point to scripts to include?

the possibility of reliance on external resources should not be

|     2   Should we allow string lists as argument to include?

I don't see the usefulness of it, but I don't care either way.

|     3   How should non-exist include scripts be handled?

error at compile-time or run-time depending on the implementation.

|     4   Interaction with variables?

global variables are visible.  numeric variables (match back
references) are kept across the include.  this enables the user to use
them for parameter passing if needed ...

    if string :matches "kjetilho(_at_)uio(_dot_)no" "*" {
        include "am_i_rcpt";


another issue is case-sensitivity for filenames.  this is glossed over
in fileinto as well, but I think it should be stated explicitly.
something like:

    The filename is case sensitive.  An implementation MAY refuse to
    allow two files whose names only differ in case.

actually, this should go into the Managesieve draft as well.

Kjetil T.