Subject: Error in rfc3028? Only one elsif allowed per if?

From: Marc Mutz <[email-masked]>
Date: Sun, 11 Aug 2002 15:51:12 +0200

Hi!

I just stumbled across this one:

rfc3028:
3.1.     Control Structure If

   There are three pieces to if: "if", "elsif", and "else".  Each is
   actually a separate command in terms of the grammar.  However, an
   elsif MUST only follow an if, and an else MUST follow only either an
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   if or an elsif.  An error occurs if these conditions are not met.

Error or intentional?

Marc

- -- 
If free-software authors lose the right to disclaim all warranties and
find themselves getting sued over the performance of the programs
they've written, they'll stop contributing free software to the world.
 -- Bruce Perens: Open Sources: Voices from the Open Source Revolution

---

From: Simon Josefsson <[email-masked]>
Date: Sun, 11 Aug 2002 17:05:56 +0200

>    elsif MUST only follow an if, and an else MUST follow only either an

It says "an elsif", not "one elsif" -- having several elsif's per if
seems fine, as they "follow" the if in some sense.  "an elsif MUST
only directly follow an if or elsif" is more clear though, the word
"follow" is not strictly defined in the language, I think.

---

From: Marc Mutz <[email-masked]>
Date: Mon, 12 Aug 2002 01:04:54 +0200

On Sunday 11 August 2002 17:05, Simon Josefsson wrote:
<snip>
> >    There are three pieces to if: "if", "elsif", and "else".  Each
> > is actually a separate command in terms of the grammar.  However,
> > an elsif MUST only follow an if, and an else MUST follow only
> > either an ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> seems fine, as they "follow" the if in some sense.

If I follow that reasoning, then there are also multiple else's allowed 
after a single if ;-) - the formulation is the same for both elsif and 
else.

>  "an elsif MUST

- -> [email-masked]?subject=errata%20rfc3028
?

Marc

BTW: Do you intend to make the capabilities available in the metadata 
map for the managesieve slave you wrote for KDE? Or shall I do that?

- -- 
Mutig warf sich die kleine Überwachungskamera zwischen Täter Opfer!
                                        --Rena Tangens / FoeBuD e.V.

---

From: "Bart Schaefer" <[email-masked]>
Date: Mon, 12 Aug 2002 00:40:08 +0000

On Aug 12,  1:04am, Marc Mutz wrote:
} Subject: Re: Error in rfc3028? Only one elsif allowed per if?
}
} On Sunday 11 August 2002 17:05, Simon Josefsson wrote:
} <snip>
} > > an elsif MUST only follow an if, and an else MUST follow only
} > > either an ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
} > >    if or an elsif.
} >
} > It says "an elsif", not "one elsif" -- having several elsif's per if
} > seems fine, as they "follow" the if in some sense.
} 
} If I follow that reasoning, then there are also multiple else's allowed 
} after a single if ;-) - the formulation is the same for both elsif and 
} else.

No:

"only follow" --> must not appear before something

"follow only" --> must not appear after any other thing

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net

---

From: Tim Showalter <[email-masked]>
Date: 12 Aug 2002 14:21:52 -0700

I think the intent is clear (i.e., same as perl or Bourne shell), but
the text is murky at best.  I'm not sure I want to defend the semantics
so that we get the right meaning--it's not worth it and I might lose.
:-)

I'll try to fix it in the next iteration.  Unfortunately since
if/elsif/else has been abstracted out of the grammar, the usual ways of
expressing them are not available.

If the intent isn't clear, you can have exactly one if clause, zero or
more elsif clauses, and zero or one else clause, in that order.

That is, If MAY be followed by an elsif or else clause.  Elsif MAY be
followed by an elsif or else clause.  Elsif MUST follow an elsif or if.
Else MUST follow an elsif or if.

Tim