diff options
author | Jürgen Hötzel <juergen@hoetzel.info> | 2016-11-12 18:29:18 +0100 |
---|---|---|
committer | ven <vendethiel@hotmail.fr> | 2016-11-12 18:29:18 +0100 |
commit | dcfbeeb614c92498c14b02f3b6840c52558e7c53 (patch) | |
tree | afe287f33b1d5aa3bd59feb227d93548bd4b49c2 /fsharp.html.markdown | |
parent | d70ad72219c11cc085026c501362be6daa3154f0 (diff) |
[fsharp/en] Use "elif" (#2566)
Diffstat (limited to 'fsharp.html.markdown')
-rw-r--r-- | fsharp.html.markdown | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fsharp.html.markdown b/fsharp.html.markdown index 69f4eb60..bbf477ba 100644 --- a/fsharp.html.markdown +++ b/fsharp.html.markdown @@ -408,11 +408,14 @@ module ActivePatternExamples = // "banana clips" are the syntax for active patterns + // You can use "elif" instead of "else if" in conditional expressions. + // They are equivalent in F# + // for example, define an "active" pattern to match character types... let (|Digit|Letter|Whitespace|Other|) ch = if System.Char.IsDigit(ch) then Digit - else if System.Char.IsLetter(ch) then Letter - else if System.Char.IsWhiteSpace(ch) then Whitespace + elif System.Char.IsLetter(ch) then Letter + elif System.Char.IsWhiteSpace(ch) then Whitespace else Other // ... and then use it to make parsing logic much clearer |