The way to write that is using the [<Literal>] attribute.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#light

[<Literal>]
let One = 1

<Literal>]
let Three = 1

let test x = 
    match x with
    | One -> printfn "one"
    | Three -> printfn "three"
    | x -> printfn "%d" x

[1 .. 5] |> List.iter test.

However, this feature was added recently and is not in the most recent release.

It will however be in the next release due out sometime soonish

By on 6/17/2008 10:18 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper