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.

F# Keyword Table


              

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

Members (F#)

Abstract Classes (F#)

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

let Bindings (F#)

Members (F#)

Constraints (F#)

Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters.

as

Classes (F#)

Pattern Matching (F#)

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

Assertions (F#)

Used to verify code during debugging.

base

Classes (F#)

Inheritance (F#)

Used as the name of the base class object.

begin

Verbose Syntax (F#)

In verbose syntax, indicates the start of a code block.

class

Classes (F#)

In verbose syntax, indicates the start of a class definition.

default

Members (F#)

Indicates an implementation of an abstract method; used together with an abstract method declaration to create a virtual method.

delegate

Delegates (F#)

Used to declare a delegate.

do

do Bindings (F#)

Loops: for...to Expression (F#)

Loops: for...in Expression (F#)

Loops: while...do Expression (F#)

Used in looping constructs or to execute imperative code.

done

Verbose Syntax (F#)

In verbose syntax, indicates the end of a block of code in a looping expression.

downcast

Casting and Conversions (F#)

Used to convert to a type that is lower in the inheritance chain.

downto

Loops: for...to Expression (F#)

In a for expression, used when counting in reverse.

elif

Conditional Expressions: if... then...else (F#)

Used in conditional branching. A short form of else if.

else

Conditional Expressions: if... then...else (F#)

Used in conditional branching.

end

Structures (F#)

Discriminated Unions (F#)

Records (F#)

Type Extensions (F#)

Verbose Syntax (F#)

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

Exception Handling (F#)

Exception Types (F#)

Used to declare an exception type.

extern

External Functions (F#)

Indicates that a declared program element is defined in another binary or assembly.

false

Primitive Types (F#)

Used as a Boolean literal.

finally

Exceptions: The try...finally Expression (F#)

Used together with try to introduce a block of code that executes regardless of whether an exception occurs.

for

Loops: for...to Expression (F#)

Loops: for...in Expression (F#)

Used in looping constructs.

fun

Lambda Expressions: The fun Keyword (F#)

Used in lambda expressions, also known as anonymous functions.

function

Match Expressions (F#)

Lambda Expressions: The fun Keyword (F#)

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

Namespaces (F#)

Used to reference the top-level .NET namespace.

if

Conditional Expressions: if... then...else (F#)

Used in conditional branching constructs.

in

Loops: for...in Expression (F#)

Verbose Syntax (F#)

Used for sequence expressions and, in verbose syntax, to separate expressions from bindings.

inherit

Inheritance (F#)

Used to specify a base class or base interface.

inline

Functions (F#)

Inline Functions (F#)

Used to indicate a function that should be integrated directly into the caller's code.

interface

Interfaces (F#)

Used to declare and implement interfaces.

internal

Access Control (F#)

Used to specify that a member is visible inside an assembly but not outside it.

lazy

Lazy Computations (F#)

Used to specify a computation that is to be performed only when a result is needed.

let

let Bindings (F#)

Used to associate, or bind, a name to a value or function.

let!

Asynchronous Workflows

Computation Expressions

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

Match Expressions (F#)

Used to branch by comparing a value to a pattern.

member

Members (F#)

Used to declare a property or method in an object type.

module

Modules (F#)

Used to associate a name with a group of related types, values, and functions, to logically separate it from other code.

mutable

let Bindings (F#)

Used to declare a variable, that is, a value that can be changed.

namespace

Namespaces (F#)

Used to associate a name with a group of related types and modules, to logically separate it from other code.

new

Constructors (F#)

Constraints (F#)

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

Symbol and Operator Reference (F#)

Constraints (F#)

Not actually a keyword. However, not struct in combination is used as a generic parameter constraint.

null

Null Values (F#)

Constraints (F#)

Indicates the absence of an object.

Also used in generic parameter constraints.

of

Discriminated Unions (F#)

Delegates (F#)

Exception Types (F#)

Used in discriminated unions to indicate the type of categories of values, and in delegate and exception declarations.

open

Import Declarations: The open Keyword (F#)

Used to make the contents of a namespace or module available without qualification.

or

Symbol and Operator Reference (F#)

Constraints (F#)

Used with Boolean conditions as a Boolean or operator. Equivalent to ||.

Also used in member constraints.

override

Members (F#)

Used to implement a version of an abstract or virtual method that differs from the base version.

private

Access Control (F#)

Restricts access to a member to code in the same type or module.

public

Access Control (F#)

Allows access to a member from outside the type.

rec

Functions (F#)

Used to indicate that a function is recursive.

return

Asynchronous Workflows (F#)

Computation Expressions (F#)

Used to indicate a value to provide as the result of a computation expression.

return!

Computation Expressions

Asynchronous Workflows

Used to indicate a computation expression that, when evaluated, provides the result of the containing computation expression.

select

Query Expressions (F#)

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

Members (F#)

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

Structures (F#)

Constraints (F#)

Used to declare a structure type.

Also used in generic parameter constraints.

Used for OCaml compatibility in module definitions.

then

Conditional Expressions: if... then...else (F#)

Constructors (F#)

Used in conditional expressions.

Also used to perform side effects after object construction.

to

Loops: for...to Expression (F#)

Used in for loops to indicate a range.

true

Primitive Types (F#)

Used as a Boolean literal.

try

Exceptions: The try...with Expression (F#)

Exceptions: The try...finally Expression (F#)

Used to introduce a block of code that might generate an exception. Used together with with or finally.

type

F# Types

Classes (F#)

Records (F#)

Structures (F#)

Enumerations (F#)

Discriminated Unions (F#)

Type Abbreviations (F#)

Units of Measure (F#)

Used to declare a class, record, structure, discriminated union, enumeration type, unit of measure, or type abbreviation.

upcast

Casting and Conversions (F#)

Used to convert to a type that is higher in the inheritance chain.

use

Resource Management: The use Keyword (F#)

Used instead of let for values that require Dispose to be called to free resources.

use!

Computation Expressions

Asynchronous Workflows

Used instead of let! in asynchronous workflows and other computation expressions for values that require Dispose to be called to free resources.

val

Explicit Fields: The val Keyword (F#)

Signatures (F#)

Members (F#)

Used in a signature to indicate a value, or in a type to declare a member, in limited situations.

void

Primitive Types (F#)

Indicates the .NET void type. Used when interoperating with other .NET languages.

when

Constraints (F#)

Used for Boolean conditions (when guards) on pattern matches and to introduce a constraint clause for a generic type parameter.

while

Loops: while...do Expression (F#)

Introduces a looping construct.

with

Match Expressions (F#)

Object Expressions (F#)

Type Extensions (F#)

Exceptions: The try...with Expression (F#)

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

Sequences (F#)

Used in a sequence expression to produce a value for a sequence.

yield!

Computation Expressions

Asynchronous Workflows

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

   
See Also


              

Reference

Symbol and Operator Reference (F#)                           

Other Resources

F# Language Reference                           
Compiler Options (F#)              

[转]Keyword Reference (F#)的更多相关文章

  1. call by reference and copy/restore

    转自:http://stackoverflow.com/questions/8848402/whats-the-difference-between-call-by-reference-and-cop ...

  2. Named function expressions demystified

    Introduction Surprisingly, a topic of named function expressions doesn't seem to be covered well eno ...

  3. IO:File类(java.io.File)

    public class File extends Object implements Serializable, Comparable<File> 构造方法: public File(S ...

  4. Java学习随笔1:Java是值传递还是引用传递?

    Java always passes arguments by value NOT by reference. Let me explain this through an example: publ ...

  5. 使用Jsoup 爬取网易首页所有的图片

    package com.enation.newtest; import java.io.File; import java.io.FileNotFoundException; import java. ...

  6. LINUX常用配置及命令

    一.   Fedora系统配置 1.      [设置网卡IP] 步骤如下: 1)     用root用户登陆,打开/etc/sysconfig/network-scripts/ifcfg-eth0文 ...

  7. Linux 该文件命令查看内容

    Linux系统,请使用以下命令来查看文件的内容: cat tac  从最后一行開始显示.能够看出 tac 是 cat 的倒著写! nl   显示的时候,顺道输出行号! more 一页一页的显示文件内容 ...

  8. Linux下PS命令详解 (转)

    要对系统中进程进行监测控制,查看状态,内存,CPU的使用情况,使用命令:/bin/ps (1)ps :是显示瞬间进程的状态,并不动态连续: (2)top:如果想对进程运行时间监控,应该用 top 命令 ...

  9. 应用spss可靠性分析软件

    问卷调查的可靠性分析 一.概念:     信度是指依据測验工具所得到的结果的一致性或稳定性,反映被測特征真实程度的指标. 一般而言,两次或两个測验的结果愈是一致.则误差愈小,所得的信度愈高,它具有下面 ...

随机推荐

  1. 一个有意思的Ruby Webdriver超时问题的解决过程

    rescue in receive 由于写ruby的时候感觉混身上下都拽起来了,所以比較喜欢用ruby写代码. 今天遇到了一个webdriver timeout的问题,问题本身还是由于我对webdri ...

  2. MJRefresh实现刷新(使用它的Block方法)

    MJRefresh实现刷新(使用它的Block方法)   // // YFMVCPostListViewController.m // iOS122 // // Created by 颜风 on 15 ...

  3. 关于axis2.1.6与websphere7的包冲突问题的解决方式

    1,复制axis2.1.6内的module目录内的全部文件到lib 并改动扩展名为.jar 2,删除module目录(可选,不删除也能够) 3,部署到was 4,设置was相应应用程序的类载入方案为父 ...

  4. 2016/3/10 PHP环境搭建 LAMP WAMP

    1. php成为服务器端的脚本语言.弱类型语言.$ JavaScript是弱类型语言.var Java强类型语言.byte short int long double float boolean 2. ...

  5. go 泛型 Go中不包含的特性

    人Andrei Alexandrescu:“Go所走的路线在一些问题上持有极其强硬和死板态度,这些问题有大有小.在比较大的方面,泛型编程被严格控制,甚至贬低到只有"N"个字:有关泛 ...

  6. IT江湖--这个冬天注定横尸遍野(多数人技术迟迟无进阶,多半是懒的原因。勤是必须的)

    今年江湖大事繁起,又至寒冬,冻的不仅是温度,更是人心. 这两天上班途中看到多个公众号和媒体发了很多 "XXX公司裁员50%" 等等诸如此类的文章,也真是撼动人心.寒冬,比以往来的更 ...

  7. POJ - 3308 Paratroopers(最大流)

    1.这道题学了个单词,product 还有 乘积 的意思.. 题意就是在一个 m*n的矩阵中,放入L个敌军的伞兵,而我军要在伞兵落地的瞬间将其消灭.现在我军用一种激光枪组建一个防御系统,这种枪可以安装 ...

  8. java抛出异常后,后续代码是否可继续执行

    参考:https://www.cnblogs.com/wangyingli/p/5912269.html 仅此可正常执行异常后内容 try{ throw new Exception("参数越 ...

  9. UITableview控件简单介绍

    注意点:数据源方法只能在控制器里设置 一.基本介绍 在众多移动应⽤用中,能看到各式各样的表格数据 . 在iOS中,要实现表格数据展示,最常用的做法就是使用UITableView,UITableView ...

  10. 函数,#include <>和#include " "区别

    l 4..函数定义到使用分三步:1.声明.2.定义函数.3.调用函数. 2.函数的定义格式:返回值 函数名(形参列表){ 函数体; return } 命名规则:1.只能由字母.数字.下划线或者美元符号 ...