程序员编程培训(程序员需要知道什么)

腾赚 2021-08-07 阅读:54
披毛犀角,虬角,独角,抹香微信号:5735363

程序员编程培训(程序员需要知道什么)


在本文中,我将简要介绍 f # 程序员实际需要知道的操作符和符号。


这是一个很好的话题,可以简化文档和 f # 教学。实际上,你需要知道的非常非常少。下面我已经将 f # 的各种操作符分类为几组——例如,我相信所有 f # 程序员都需要知道的操作符。

你需要知道的

显而易见的

+ - * / Arithmetic 数学运算 < > <= >= Comparison 大小比较

需要了解一些的

() Empty value (“unit”) = <> Comparison (needs teaching because different to other languages) && || Boolean (needs teaching because not all students know programming) 3 :: xs Cons onto a list (note, you can use List.Cons(3, xs) instead. However :: is necessary when pattern matching on lists) | … -> Rule in pattern matching _ Wildcard in pattern matching 'T Generic type parameter n..m Ranges (within a list or sequence or loop) expr : type Type constraint (also for patterns) expr :? type Type test (also in patterns) expr :> type Cast up expr :?> type Cast down expr |> f Pipelining thing <- expr Mutation of local, field etc. ``abc def`` Identifier with whacky characters
进阶需要知道的

下面是一些在高级玩法中需要了解的操作父,这些操作符会出现在函数的特定部分,比如函数编程,以及F# 引用

f1 >> f2 Function composition (expr1, expr2) ||> f Two-argument pipelining (expr1, expr2, expr3) |||> f Three-argument pipelining n..step..m Range with step (within a list or sequence or loop) let (|A|_|) arg = … Defining active patterns let (|A|B|) arg = … Defining active patterns <@ … @> Code quotation (expression tree) <> Code quotation (expression tree, untyped)

还有一些是在FSharp源代码中可以找到,但是日常也不一定需要了解的

% Modulus &&& ||| ^^^ Bitwise (&& in C#) <<< >>> Bitwise shift (<< in C#) ~~~ Bitwise negation (~ in C#)
接下来是你不需要知道的

下面这些通常是不需要知道,也不建议使用的

!cell Dereference a mutable reference cell. Use cell.Value instead := Assign a mutable reference cell. Use "cell.Value <- expr" instead @ Append one list to another. Can normally use a computed list expression or List.append instead << Backward function composition, discouraged in favour of forward composition <| Back-piping, discouraged in favour of forward piping <|| Back-piping, discouraged in favour of forward piping <||| Back-piping, discouraged in favour of forward piping *?, +? … Nullable operators (these are used exceptionally rarely in LINQ queries, ignore these)


能够收藏一件好的文玩是一种缘分,很多朋友想入手文玩,可是因为了解不是很深,所以担心买到假货,您可以关注【微信号:5735363】,我们为您免费提供更多文玩资讯、鉴定等咨询服务。

评论(0)

二维码