Hide this comment

Functions with out parameters are treated as tuple types with the return type so you could use your example like so:

let (result, result_of_b_param) = function 3
let (result, int_value) = Int32.TryParse "3"

match Int32.TryParse "23" with
| (true, x) -> ...
| _ -> ...

By on 5/16/2009 12:20 AM ()Reply
Hide this comment

That's ok, but is there any way to declare such a funciton?

By on 5/16/2009 3:36 AM ()Reply
Hide this comment

That's ok, but is there any way to declare such a funciton?

You can use the the attribute System.Runtime.InteropServices.OutAttribute on function parameters:

open System.Runtime.InteropServices

type foo () =
member x.Foo ([<Out>] y : int32 ref) =
y := 0

By on 5/16/2009 4:20 AM ()Reply
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

Logging in...