[lokisetup] New feature : boolean variables and expressions
Ludwig Nussel
ludwig.nussel at suse.de
Fri Mar 31 07:18:00 EST 2006
On Thursday 30 March 2006 02:20, Stéphane Peter wrote:
> [...]
> About Boolean Expressions :
>
> Many elements support the 'if' or 'condition' attribute to reference
> complex expressions
> using the Setup boolean variables. The expressions have to follow the
> following syntax:
>
> expression := [!]<operator>(<expression1>,<expression2>) |
> [!]<boolean name>
>
> Supported operators are : + (logical "and"), | (logical "or"), and ^
> (logical "exclusive or").
> Any expression can be negated by a ! prefix.
> An undefined boolean is the same as a false boolean.
>
> Some examples :
>
> Match Fedora on PowerPC system:
> +(fedora,ppc)
> Match one of SuSE, Redhat 9 or Fedora, on all but Intel:
> +(^(suse,+(redhat,distro-major-9),fedora),!x86)
Intereting idea but the syntax is really weird. If you move the
operator inside the parenthesis you could say it's like lisp.
(and (or? suse (and redhat distro-major-9) fedora) (not x86))
You could also just use xml to represent that expression. You don't
need an additional parser then.
cu
Ludwig
--
(o_ Ludwig Nussel
//\ SUSE LINUX Products GmbH, Development
V_/_ http://www.suse.de/
More information about the Lokisetup
mailing list