[转]Keyword Reference (F#)
Visual F# Development Portal
http://msdn.microsoft.com/en-us/library/vstudio/ff730280.aspx
本文转自:http://msdn.microsoft.com/en-us/library/vstudio/dd233249.aspx
This topic contains links to information about all F# language keywords.
The following table shows all F# keywords in alphabetical order, together with brief descriptions and links to relevant topics that contain more information.
Keyword |
Link |
Description |
---|---|---|
abstract |
Indicates a method that either has no implementation in the type in which it is declared or that is virtual and has a default implementation. |
|
and |
Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. |
|
as |
Used to give the current class object an object name. Also used to give a name to a whole pattern within a pattern match. |
|
assert |
Used to verify code during debugging. |
|
base |
Used as the name of the base class object. |
|
begin |
In verbose syntax, indicates the start of a code block. |
|
class |
In verbose syntax, indicates the start of a class definition. |
|
default |
Indicates an implementation of an abstract method; used together with an abstract method declaration to create a virtual method. |
|
delegate |
Used to declare a delegate. |
|
do |
Loops: for...to Expression (F#) |
Used in looping constructs or to execute imperative code. |
done |
In verbose syntax, indicates the end of a block of code in a looping expression. |
|
downcast |
Used to convert to a type that is lower in the inheritance chain. |
|
downto |
In a for expression, used when counting in reverse. |
|
elif |
Used in conditional branching. A short form of else if. |
|
else |
Used in conditional branching. |
|
end |
In type definitions and type extensions, indicates the end of a section of member definitions. In verbose syntax, used to specify the end of a code block that starts with the begin keyword. |
|
exception |
Used to declare an exception type. |
|
extern |
Indicates that a declared program element is defined in another binary or assembly. |
|
false |
Used as a Boolean literal. |
|
finally |
Used together with try to introduce a block of code that executes regardless of whether an exception occurs. |
|
for |
Used in looping constructs. |
|
fun |
Used in lambda expressions, also known as anonymous functions. |
|
function |
Used as a shorter alternative to the fun keyword and a match expression in a lambda expression that has pattern matching on a single argument. |
|
global |
Used to reference the top-level .NET namespace. |
|
if |
Used in conditional branching constructs. |
|
in |
Used for sequence expressions and, in verbose syntax, to separate expressions from bindings. |
|
inherit |
Used to specify a base class or base interface. |
|
inline |
Used to indicate a function that should be integrated directly into the caller's code. |
|
interface |
Used to declare and implement interfaces. |
|
internal |
Used to specify that a member is visible inside an assembly but not outside it. |
|
lazy |
Used to specify a computation that is to be performed only when a result is needed. |
|
let |
Used to associate, or bind, a name to a value or function. |
|
let! |
Used in asynchronous workflows to bind a name to the result of an asynchronous computation, or, in other computation expressions, used to bind a name to a result, which is of the computation type. |
|
match |
Used to branch by comparing a value to a pattern. |
|
member |
Used to declare a property or method in an object type. |
|
module |
Used to associate a name with a group of related types, values, and functions, to logically separate it from other code. |
|
mutable |
Used to declare a variable, that is, a value that can be changed. |
|
namespace |
Used to associate a name with a group of related types and modules, to logically separate it from other code. |
|
new |
Used to declare, define, or invoke a constructor that creates or that can create an object. Also used in generic parameter constraints to indicate that a type must have a certain constructor. |
|
not |
Not actually a keyword. However, not struct in combination is used as a generic parameter constraint. |
|
null |
Indicates the absence of an object. Also used in generic parameter constraints. |
|
of |
Used in discriminated unions to indicate the type of categories of values, and in delegate and exception declarations. |
|
open |
Used to make the contents of a namespace or module available without qualification. |
|
or |
Used with Boolean conditions as a Boolean or operator. Equivalent to ||. Also used in member constraints. |
|
override |
Used to implement a version of an abstract or virtual method that differs from the base version. |
|
private |
Restricts access to a member to code in the same type or module. |
|
public |
Allows access to a member from outside the type. |
|
rec |
Used to indicate that a function is recursive. |
|
return |
Used to indicate a value to provide as the result of a computation expression. |
|
return! |
Used to indicate a computation expression that, when evaluated, provides the result of the containing computation expression. |
|
select |
Used in query expressions to specify what fields or columns to extract. Note that this is a contextual keyword, which means that it is not actually a reserved word and it only acts like a keyword in appropriate context. |
|
static |
Used to indicate a method or property that can be called without an instance of a type, or a value member that is shared among all instances of a type. |
|
struct |
Used to declare a structure type. Also used in generic parameter constraints. Used for OCaml compatibility in module definitions. |
|
then |
Used in conditional expressions. Also used to perform side effects after object construction. |
|
to |
Used in for loops to indicate a range. |
|
true |
Used as a Boolean literal. |
|
try |
Used to introduce a block of code that might generate an exception. Used together with with or finally. |
|
type |
Used to declare a class, record, structure, discriminated union, enumeration type, unit of measure, or type abbreviation. |
|
upcast |
Used to convert to a type that is higher in the inheritance chain. |
|
use |
Used instead of let for values that require Dispose to be called to free resources. |
|
use! |
Used instead of let! in asynchronous workflows and other computation expressions for values that require Dispose to be called to free resources. |
|
val |
Used in a signature to indicate a value, or in a type to declare a member, in limited situations. |
|
void |
Indicates the .NET void type. Used when interoperating with other .NET languages. |
|
when |
Used for Boolean conditions (when guards) on pattern matches and to introduce a constraint clause for a generic type parameter. |
|
while |
Introduces a looping construct. |
|
with |
Used together with the match keyword in pattern matching expressions. Also used in object expressions, record copying expressions, and type extensions to introduce member definitions, and to introduce exception handlers. |
|
yield |
Used in a sequence expression to produce a value for a sequence. |
|
yield! |
Used in a computation expression to append the result of a given computation expression to a collection of results for the containing computation expression. |
In addition, the following tokens are reserved in F# because they are keywords in the OCaml language:
asr |
land |
lor |
lsl |
lsr |
lxor |
mod |
sig |
If you use the --mlcompatibility compiler option, these keywords are available for use as identifiers.
The following tokens are reserved as keywords for future expansion of the F# language:
atomic |
break |
checked |
component |
const |
constraint |
constructor |
continue |
eager |
event |
external |
fixed |
functor |
include |
method |
mixin |
object |
parallel |
process |
protected |
pure |
sealed |
tailcall |
trait |
virtual |
volatile |
Reference
Other Resources
[转]Keyword Reference (F#)的更多相关文章
- call by reference and copy/restore
转自:http://stackoverflow.com/questions/8848402/whats-the-difference-between-call-by-reference-and-cop ...
- Named function expressions demystified
Introduction Surprisingly, a topic of named function expressions doesn't seem to be covered well eno ...
- IO:File类(java.io.File)
public class File extends Object implements Serializable, Comparable<File> 构造方法: public File(S ...
- Java学习随笔1:Java是值传递还是引用传递?
Java always passes arguments by value NOT by reference. Let me explain this through an example: publ ...
- 使用Jsoup 爬取网易首页所有的图片
package com.enation.newtest; import java.io.File; import java.io.FileNotFoundException; import java. ...
- LINUX常用配置及命令
一. Fedora系统配置 1. [设置网卡IP] 步骤如下: 1) 用root用户登陆,打开/etc/sysconfig/network-scripts/ifcfg-eth0文 ...
- Linux 该文件命令查看内容
Linux系统,请使用以下命令来查看文件的内容: cat tac 从最后一行開始显示.能够看出 tac 是 cat 的倒著写! nl 显示的时候,顺道输出行号! more 一页一页的显示文件内容 ...
- Linux下PS命令详解 (转)
要对系统中进程进行监测控制,查看状态,内存,CPU的使用情况,使用命令:/bin/ps (1)ps :是显示瞬间进程的状态,并不动态连续: (2)top:如果想对进程运行时间监控,应该用 top 命令 ...
- 应用spss可靠性分析软件
问卷调查的可靠性分析 一.概念: 信度是指依据測验工具所得到的结果的一致性或稳定性,反映被測特征真实程度的指标. 一般而言,两次或两个測验的结果愈是一致.则误差愈小,所得的信度愈高,它具有下面 ...
随机推荐
- ZOJ 3632 Watermelon Full of Water (线段树 区间更新 + dp)
题目大意: 让每天都能吃到西瓜. 最少须要花多少钱. 思路分析: dp[pos] 就表示 要让 前i天每天都有西瓜吃.最少须要花多少钱. 那么假设你买这个西瓜的话. 那么这个西瓜能吃的持续时间都要更 ...
- [MAT]使用MAT比較多个heap dump文件
使用MAT比較多个heap dump文件 调试内存泄露时,有时候适时比較2个或多个heap dump文件是非常实用的.这时须要生成多个单独的HPROF文件. 以下是一些关于怎样在MAT里比較多个hea ...
- Process类的使用
Process process= new Process(); process.StartInfo.CreateNoWindow = true; process.StartInfo.UseShellE ...
- Windows server 2003 + IIS6 搭建Asp.net MVC执行环境
安装.Net Framework4.0. 下载地址: http://www.microsoft.com/zh-cn/download/details.aspx?id=17718 安装WindowsS ...
- java 报错非法的前向引用
今天在看<thinking in java>的时候,第四章提到了非法的前向引用,于是自己试了一下,书中的例子倒是一下就明白了,但是自己写的一个却怎么也不明白,于是上网问了一位前辈,终于明白 ...
- YTU 1020: I think it
1020: I think it 时间限制: 1 Sec 内存限制: 32 MB 提交: 501 解决: 63 题目描述 Xiao Ming is only seven years old, No ...
- HDU - 2063 过山车(最大匹配数)(模板)
1.男生女生一起坐过山车,每一排有两个座位,但是有个条件,就是每个女生必须找个男生做同伴一起(但是女生只愿意和某几个男生中的一个做同伴),求最多可以有多少对男女生组合坐上过山车. 2.二分图的最大匹配 ...
- 主机与虚拟机互ping
1.设置虚拟机网络连接方式(如下图): 2.设置主机和虚拟机的ip为同一个网段,如主机ip:192.168.28.1,虚拟机ip:192.168.28.128 3.如果相互还是ping不通,就检查一下 ...
- I.MX6 Battery issues
/******************************************************************** * I.MX6 Battery issues * 说明: * ...
- C# ListView 列宽调整 刷新
/*********************************************************************** * C# ListView 列宽调整 刷新 * 说明: ...