Andre Poenitz <[EMAIL PROTECTED]> writes:

| Could you please add that to the coding style rules. IIRC the general
| rule is to avoid unnecessary braces in general but I agree that this is
| a case where the unnecessary braces might even be preferable.

Like this perhaps:

? rules-1.diff
Index: Code_rules/Rules
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/development/Code_rules/Rules,v
retrieving revision 1.16
diff -u -p -r1.16 Rules
--- Code_rules/Rules	28 Oct 2004 14:35:18 -0000	1.16
+++ Code_rules/Rules	6 Dec 2004 13:11:18 -0000
@@ -262,6 +262,14 @@ Formatting
 		THREE = 3
 	};
 
+* Tertiary ?: operator
+
+  Add parenthesis to make the statement clearer:
+
+	int foo = (forba() == hans ? some1() : some2());
+	-NOT-
+	int foo = forba() == hans ? some1() : some2();
+
 * Naming rules for classes
 
   - Use descriptive but simple and short names. For stuff specific to LyX
-- 
        Lgb

Reply via email to