categoryF#

match

trackback1  comment0
プログラミング覚書 F#-004

match
----------------------------------------------------------------------

let NumToString n =
match n with
| 1 -> "one"
| 2 -> "two"
| _ -> "another number"

printf "%s\n" (NumToString 2);;
printf "%s\n" (NumToString 1);;
printf "%s\n" (NumToString 3);;

----------------------------------------------------------------------
関連記事
 









        
 
http://greenwind888.blog.fc2.com/tb.php/276-372da7af
まとめtyaiました【match】
プログラミング覚書 F#-004match----------------------------------------------------------------------let NumToString n = match n with | 1 -