OCaml style syntax:

1
2
3
4
let rec printFib a b c =
    match c with
    | _ when c < (a + b) -> printf "fib:%i\n" (a+b); printFib b (a+b) c
    | _ -> 0

F# "light" whitespace sentive syntax:

1
2
3
4
5
6
7
#light
let rec printFibLight a b c =
    match c with
    | _ when c < (a + b) -> 
        printf "fib:%i\n" (a+b)
        printFibLight b (a+b) c
    | _ -> 0
By on 3/11/2008 9:16 AM ()

ah .. Prefect! thanks.

By on 3/11/2008 11:47 AM ()

You can check out more about syntax in F# Manual
[link:research.microsoft.com]

By on 3/12/2008 6:05 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