Programming-Idioms

History of Idiom 131

Idiom #131 Successive conditions

Execute f1 if condition c1 is true, or else f2 if condition c2 is true, or else f3 if condition c3 is true.
Don't evaluate a condition when a previous condition was true.

#Edit dateEdit SummaryAuthor
👁 Δ 52 2020-09-08, 15:25 New Dart implementation by user [boukeversteegh] boukeversteegh
👁 Δ 51 2020-07-18, 21:50 [Rust] Emphasize in comments programming-idioms.org
👁 Δ 50 2020-07-18, 21:50 [Rust] Emphasize in comments programming-idioms.org
👁 Δ 49 2020-07-15, 17:59 [Rust] The conditions could all be false Plecra
👁 Δ 48 2020-03-02, 14:25 New Lua implementation by user [Zo] Zo
👁 Δ 47 2019-10-18, 14:15 New Kotlin implementation by user [ruibritopt] ruibritopt
👁 Δ 46 2019-10-01, 15:10 [Ada] updating variable names thethanlaw
👁 Δ 45 2019-10-01, 15:10 [C] requires if for final else per the problem statement thethanlaw
👁 Δ 44 2019-10-01, 15:09 New C implementation by user [thethanlaw] thethanlaw
👁 Δ 43 2019-10-01, 10:45 New Cpp implementation by user [Stanley] Stanley
👁 Δ 42 2019-10-01, 04:52 New Ada implementation by user [thethanlaw] thethanlaw
👁 Δ 41 2019-09-30, 19:20 New VB implementation by user [silver-dragon] silver-dragon
👁 Δ 40 2019-09-27, 20:50 New Cobol implementation by user [Roie8] Roie8
👁 Δ 39 2019-09-27, 11:22 New Clojure implementation by user [MrEbbinghaus] MrEbbinghaus
👁 Δ 38 2019-09-27, 09:52 New Erlang implementation by user [nopeslide] nopeslide
👁 Δ 37 2019-09-26, 18:10 New Cpp implementation by user [arouene] arouene
👁 Δ 36 2019-09-26, 18:08 New Cpp implementation by user [arouene] arouene
👁 Δ 35 2019-09-26, 17:32 New Fortran implementation by user [tkoenig] tkoenig
👁 Δ 34 2019-09-26, 15:58 [Lisp] execute the fs foobar
👁 Δ 33 2019-09-26, 15:57 New Lisp implementation by user [foobar] foobar
👁 Δ 32 2019-09-26, 14:49 New Python implementation by user [koltrast] koltrast
👁 Δ 31 2019-09-26, 13:58 [Csharp] Remove unnecessary underscores JWT
👁 Δ 30 2019-09-26, 13:57 [Csharp] Tabs to spaces JWT
👁 Δ 29 2019-09-26, 13:57 New Csharp implementation by user [JWT] JWT
👁 Δ 28 2019-05-31, 12:23 New Java implementation by user [miso] miso
👁 Δ 27 2019-05-21, 09:12 [PHP] Corrected variable prefixes pietrobe03
👁 Δ 26 2019-05-21, 09:11 New PHP implementation by user [pietrobe03] pietrobe03
👁 Δ 25 2019-02-02, 04:09 New JS implementation by user [Debaran] Debaran
👁 Δ 24 2019-02-02, 04:07 New JS implementation by user [Debaran] Debaran
👁 Δ 23 2019-02-02, 04:01 New Scala implementation by user [Debaran] Debaran
👁 Δ 22 2019-02-02, 03:59 New Rust implementation by user [Debaran] Debaran
👁 Δ 21 2019-02-02, 03:47 [Rust] Added explanation, fixed parens Debaran
👁 Δ 20 2019-02-02, 03:44 New Scala implementation by user [Debaran] Debaran
👁 Δ 19 2019-01-24, 12:42 New JS implementation by user [1.7.4] 1.7.4
👁 Δ 18 2017-11-23, 10:28 [Elixir] idiom is better served with cond statement mitosis
👁 Δ 17 2017-11-23, 10:25 [Elixir] added relevant comment mitosis
👁 Δ 16 2017-11-23, 10:20 New Elixir implementation by user [mitosis] mitosis
👁 Δ 15 2017-09-21, 17:12 [Haskell] typo Alekzcb
👁 Δ 14 2017-09-21, 17:11 [Haskell] neater formatting Alekzcb
👁 Δ 13 2017-09-21, 17:11 New Haskell implementation by user [Alekzcb] Alekzcb
👁 Δ 12 2017-08-09, 22:28 [Python] Emphasis in comments (not in code) programming-idioms.org
👁 Δ 11 2017-08-09, 08:48 New Python implementation by user [cpoulet_42] cpoulet_42
👁 Δ 10 2017-04-07, 18:39 New Rust implementation by user [Tim] Tim
👁 Δ 9 2016-07-14, 10:45 [Go] Slightly better demo programming-idioms.org
👁 Δ 8 2016-07-08, 16:29 New Pascal implementation by user [Bart] Bart
👁 Δ 7 2016-05-23, 20:17 New D implementation by user [piou] piou
👁 Δ 6 2016-05-06, 00:41 New Perl implementation by user [Roboticus] Roboticus
👁 Δ 5 2016-05-03, 20:23 New Ruby implementation by user [steenslag] steenslag
👁 Δ 4 2016-05-03, 12:42 New Scheme implementation by user [programming-idioms.org] programming-idioms.org
👁 Δ 3 2016-05-03, 12:41 [Go] Clearer and conciser when c1, c2, c3 are not funcs programming-idioms.org
👁 Δ 2 2016-05-03, 12:39 [Go] +DocURL programming-idioms.org
1 2016-05-03, 12:37 Idiom creation by user [programming-idioms.org] programming-idioms.org