Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/fsharp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
F#类型提供程序-如何为输出参数赋值?_F#_Type Providers - Fatal编程技术网

F#类型提供程序-如何为输出参数赋值?

F#类型提供程序-如何为输出参数赋值?,f#,type-providers,F#,Type Providers,ProvidedParameter的构造函数接受一个值isOut:bool,我认为这意味着提供的函数可以支持C 35;out参数 但是,我找不到任何方法来构造Expr来设置InvokeCode中out参数的值。下面是一个例子: testType.AddMember( let outParam = ProvidedParameter("outDate", typeof<DateTime>, true) let outFunc = ProvidedMethod("GetT

ProvidedParameter
的构造函数接受一个值
isOut:bool
,我认为这意味着提供的函数可以支持C 35;
out
参数

但是,我找不到任何方法来构造Expr来设置
InvokeCode
out
参数的值。下面是一个例子:

testType.AddMember(
    let outParam = ProvidedParameter("outDate", typeof<DateTime>, true)
    let outFunc = ProvidedMethod("GetTomorrow", [outParam], typeof<unit>)
    do outFunc.InvokeCode <-
        fun p ->
            // "Invalid expression on left of assignment"
            <@@ do %%(p.[1]) <- DateTime.Today.AddDays 1.0 @@>
    outFunc)
testType.AddMember(
let outParam=ProvidedParameter(“outDate”,typeof,true)
let outpunc=ProvidedMethod(“GetTomorrow”,[outParam],typeof)
执行outpunc.InvokeCode
//“赋值左边的表达式无效”

我快速查看了一下,即使没有代码,提供的方法看起来也不像是带有
out
参数的方法,所以我猜这是不受支持的。我会首先尝试更新到最新版本的类型提供程序SDK,但即使如此,我也不确定是否有办法做到这一点-也就是说,我可能会使用正常的返回值不管怎么说,还是滚蛋!