On 22 May 2003 13:32:22 +0200, Mathias Megyei;Munich wrote:
> 
> Mikhael Goikhman writes:
>  > On 22 May 2003 09:29:44 +0200, Dominik Vogt wrote:
>  > > 
>  > > I think "On" is only something programmers understand.  How about
>  > > renaming it to "Test" (like the shell command) before 2.6?
>  > 
>  > No opinion here. You may rename it if you like.
>  > 
>  > I think it sounds naturally for an English man when used as:
>  > 
>  >   On (Version 2.6.0) do something
>  >   On (Restart) do something  # this condition is only true in .fvwm2rc
>  > 
>  > It may be renamed to "If" as well.
> 
> What about "Given"?
> ("Given" will be introduced in Perl 6 for statement like
>   switch ... case.)

Just thought about something new. The current "Cond" and "CondCase"
may probably be mixed into the "On" command.

If we take this "Given" suggestion here goes:

  Next (XTerm) WarpToWindow
  Given (Match) Focus
  Given (!Match) Break

Actually this "Given" syntax is for "Cond".  "CondCase (Match)" may be
replaced with "Given (Match) Continue". Yes I think it is good and useful
to have Continue command (prefix) that just preserves the previous
returning code ignoring a possible returning code of the current command.

Here is an example for a case statement:

  Given (Version < 2.7.2) Echo Please upgrade to at least 2.7.2
  Given (Match)    # do something old
  Given (NoMatch)  # do something new for 2.7.2+

Another examples (probably "-" may be optional):

  Given (-x fvwm-root) Exec fvwm-root bg.xpm
  Given (NoMatch) Exec xmessage "Fix your PATH for fvwm-config & fvwm-root"

  Next (MyConsole) MoveToDesk
  Given (Match) Raise
  Given (!Match) Given (-x rxvt) Exec rxvt -name MyConsole
  Given (NoMatch, -x xterm) Exec xterm -name MyConsole

I think that I like this syntax.

Regards,
Mikhael.
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [EMAIL PROTECTED]
To report problems, send mail to [EMAIL PROTECTED]

Reply via email to