home > 比較編 > F#, Scala, Haskell > data types >

ForNext

Only Do What Only You Can Do

083. match catchall

VBScript

JScript

Perl

PHP

Python

Ruby

PowerShell

Scala

val c : Color = Green
c match { case Red => "red"; case _ => "not red" }

F#

OCaml

let to_s c = match c with Red -> "red" | _ -> "not red";;
to_s Green;;

Haskell

c = Green
case c of Red -> "red"; _ -> "not red"

C

C++

C++Builder

VC++

C#

Java

Objective-C

D

VB

VB.NET

Delphi

Ada

PL/SQL

T-SQL

inserted by FC2 system