问题描述
来自本课:
让stockData = [ "2012-03-30,32.40,32.41,32.04,32.26,31749400,32.26"; "2012-03-29,32.06,32.19,31.81,32.12,37038500,32.12"; ..................................................... "2012-03-01,31.93,32.39,31.85,32.29,77344100,32.29"; "2012-02-29,31.89,32.00,31.61,31.74,59323600,31.74"; ] 让splitCommas(x:string)= x.Split([|','|]) stockData |> List.map splitCommas |> List.maxBy(fun x-> abs(float x.[1]-float x.[4])) |> (有趣的x-> x.[0])
为什么我不能使用下面的代码?
(有趣x-> x.[0])( List.maxBy(有趣x-> abs(float x.[1]-float x.[4]))
List.map splitCommas stockData)
from the lesson:
let stockData = [ "2012-03-30,32.40,32.41,32.04,32.26,31749400,32.26"; "2012-03-29,32.06,32.19,31.81,32.12,37038500,32.12"; ............................................ "2012-03-01,31.93,32.39,31.85,32.29,77344100,32.29"; "2012-02-29,31.89,32.00,31.61,31.74,59323600,31.74"; ] let splitCommas (x:string) = x.Split([|','|]) stockData |> List.map splitCommas |> List.maxBy (fun x -> abs(float x.[1] - float x.[4])) |> (fun x -> x.[0])
Why I can not use the code below instead? and How can i code without pipe?
(fun x -> x.[0])(List.maxBy (fun x -> abs(float x.[1] - float x.[4]))
List.map splitCommas stockData)
这篇关于前卫管道运营商的怀疑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!