[Top] [All Lists]

Re: testing for extensions during run-time

2006-01-12 09:43:32

On Wed, Jan 11, 2006 at 02:14:59AM +0100, Kjetil Torgrim Homme wrote:

On Tue, 2006-01-10 at 19:06 -0500, Barry Leiba wrote:
I still wonder whether there ought to be a way to test for the presence
of an extension, rather than only to have the choice of *requiring* it
or not using it at all.  I can see a script wanting, for example, to
send a notification IF the Notify extension is available, but not
wanting the script to FAIL if it's not.

it certainly seems useful to me.  we could introduce an action, like:

  require "environment";
  # or perhaps a separate extension.
  want "notify";
  if environment "extensions" "notify" {

I must be missing something, but why would you want to write scripts
that way? Which application would profit from this extension?

I can imagine that a way to find out which extensions are available
is very useful for GUIs generating Sieve code, or even humans, but
for scripts?

If I used a GUI and it offers notifications, then I expect they are

I don't think the base specification unconditionally allows dead
code blocks that contain unknown extensions, like:

  if false {

Does the environment extension focus on the above usage and is it OK if
it enforces implementations to allow unknown extensions in dead code?