- From: Christoph Päper via GitHub <sysbot+gh@w3.org>
- Date: Tue, 04 Feb 2020 13:48:15 +0000
- To: public-css-archive@w3.org
*Perhaps*, CSS would be better suited with a generic `compare()` function that compared its first two parameters and returned one of the others accordingly, or a set of three slightly more specific functions, `equal()`, `lesser()` and `greater()`: ~~~~ js if(A < B, C, D) = lesser(A, B, C, D) = if(B > A, C, D) = greater(B, A, C, D) = if(A >= B, D, C) = if(B =< A, D, C) = compare(A, B, C, D, D) = compare(B, A, D, C, D) if(A >= B, C, D) = if(B =< A, C, D) = if(A < B, D, C) = lesser(A, B, D, C) = if(B > A, D, C) = greater(B, A, D, C) = compare(A, B, D, C, C) = compare(B, A, C, D, C) if(A > B, C, D) = greater(A, B, C, D) = if(B < A, C, D) = lesser(B, A, C, D) = if(A =< B, D, C) = if(B >= A, D, C) = compare(A, B, D, C, D) = compare(B, A, C, D, D) if(A =< B, C, D) = if(B >= A, C, D) = if(A > B, D, C) = greater(A, B, D, C) = if(B < A, D, C) = lesser(B, A, D, C) = compare(A, B, C, D, C) = compare(B, A, D, C, C) if(A != B, C, D) = compare(A, B, C, D) = if(B != A, C, D) = compare(B, A, C, D) = if(A == B, D, C) = equal(A, B, D, C) = if(B == A, D, C) = equal(A, B, D, C) if(A == B, C, D) = equal(A, B, C, D) = if(B == A, C, D) = equal(B, A, C, D) = if(A != B, D, C) = compare(A, B, D, C) = if(B != A, D, C) = compare(B, A, D, C) ~~~~ (The order and fallback of the comparison function parameters could probably be optimized more.) -- GitHub Notification of comment by Crissov Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4731#issuecomment-581917273 using your GitHub account
Received on Tuesday, 4 February 2020 13:48:17 UTC