`
talin2010
  • 浏览: 520724 次
  • 性别: Icon_minigender_1
  • 来自: 河北
社区版块
存档分类
最新评论

15.4 Labeled statements

F# 
阅读更多
blocks, but are not permitted as embedded statements.
labeled-statement:
identifier : statement
A labeled statement declares a label with the name given by the identifier.
The scope of a label is the whole
block in which the label is declared, including any nested blocks. It is a
compile-time error for two labels
with the same name to have overlapping scopes.
A label can be referenced from goto statements (§15.9.3) within the scope
of the label. [Note: This means
that goto statements can transfer control within blocks and out of blocks,
but never into blocks. end note]
Labels have their own declaration space and do not interfere with other
identifiers. [Example: The example
int F(int x) {
if (x >= 0) goto x;
x = -x;
x: return x;
}
is valid and uses the name x as both a parameter and a label. end example]
Execution of a labeled statement corresponds exactly to execution of the
statement following the label.
In addition to the reachability provided by normal flow of control, a
labeled statement is reachable if the
label is referenced by a reachable goto statement. (Exception: If a goto
statement is inside a try that
includes a finally block, and the labeled statement is outside the try, and
the end point of the finally
block is unreachable, then the labeled statement is not reachable from that
goto statement.)
15.5 Declaration statements
A declaration-statement declares a local variable or constant. Declaration
statements are permitted in blocks,
but are not permitted as embedded statements.
declaration-statement:
local-variable-declaration ;
local-constant-declaration ;
15.5.1 Local variable declarations
A local-variable-declaration declares one or more local variables.
local-variable-declaration:
type local-variable-declarators
Chapter 15 Statements
181
local-variable-declarators:
local-variable-declarator
local-variable-declarators , local-variable-declarator
local-variable-declarator:
identifier
identifier = local-variable-initializer
local-variable-initializer:
expression
array-initializer
The type of a local-variable-declaration specifies the type of the
variables introduced by the declaration.
The type is followed by a list of local-variable-declarators, each of which
introduces a new variable. A
local-variable-declarator consists of an identifier that names the
variable, optionally followed by an
.=. token and a local-variable-initializer that gives the initial value of
the variable.
The value of a local variable is obtained in an expression using a
simple-name (§14.5.2), and the value of a
local variable is modified using an assignment (§14.13). A local variable
must be definitely assigned (§12.3)
at each location where its value is obtained.
The scope of a local variable declared in a local-variable-declaration is
the block in which the declaration
occurs. It is an error to refer to a local variable in a textual position
that precedes the local-variabledeclarator
of the local variable. Within the scope of a local variable, it is a
compile-time error to declare
another local variable or constant with the same name.
A local variable declaration that declares multiple variables is equivalent
to multiple declarations of single
variables with the same type. Furthermore, a variable initializer in a
local variable declaration corresponds
exactly to an assignment statement that is inserted immediately after the
declaration.
[Example: The example
void F() {
int x = 1, y, z = x * 2;
}
corresponds exactly to
void F() {
int x; x = 1;
int y;
int z; z = x * 2;
}
end example]
15.5.2 Local constant declarations
A local-constant-declaration declares one or more local constants.
local-constant-declaration:
const type constant-declarators
constant-declarators:
constant-declarator
constant-declarators , constant-declarator
constant-declarator:
identifier = constant-expression
The type of a local-constant-declaration specifies the type of the
constants introduced by the declaration.
The type is followed by a list of constant-declarators, each of which
introduces a new constant. A constantdeclarator
consists of an identifier that names the constant, followed by an .=.
token, followed by a
constant-expression (§14.15) that gives the value of the constant.
C# LANGUAGE SPECIFICATION
182
The type and constant-expression of a local constant declaration must
follow the same rules as those of a
constant member declaration (§17.3).
The value of a local constant is obtained in an expression using a
simple-name (§14.5.2).
The scope of a local constant is the block in which the declaration occurs.
It is an error to refer to a local
constant in a textual position that precedes its constant-declarator.
Within the scope of a local constant, it is
a compile-time error to declare another local variable or constant with the
same name.
A local constant declaration that declares multiple constants is equivalent
to multiple declarations of single
constants with the same type.
分享到:
评论

相关推荐

    labeled LDA

    "Labeled LDA",全称是“有监督学习的Latent Dirichlet Allocation”,是一种结合了监督学习和无监督学习的文本主题模型。它在传统的Latent Dirichlet Allocation(LDA)基础上增加了标签信息,使得模型在生成主题的...

    LFW(Labeled Faces in the Wild)人像图像数据集.zip

    LFW,全称为Labeled Faces in the Wild,是一个广泛应用于人脸识别研究的重要数据集。它的出现,为无约束环境下的面部识别技术带来了革命性的突破。无约束,意味着在实际应用中,面部识别系统需要处理各种复杂条件下...

    Java 中少为人知的小点子

    Labeled Statements 是 Java 语言中的一种语句,它允许我们使用标签来标记一段代码。例如: ``` 1: for(int I1 = 0; I1 ; I1++) { 2: loop1: 3: for(int I2 = 0; I2 ; I1++) { 4: break loop1; 5: } 6: } ``` 在上面...

    Labeled Faces in the Wild A Database for Studying Face Recognition

    LFW(Labeled Faces in the Wild)人脸库是一个专门为研究在非受限环境下的人脸识别问题而设计的数据库。它提供了一系列带有人脸标注的照片集,这些照片涵盖了人们在日常生活中可能遇到的各类条件,包括姿态、照明、...

    Labeled Faces in the Wild 面部照片数据集.7z

    Labeled Faces in the Wild Dataset 是一个面部图像数据集,专为研究无约束人脸识别开发,该数据集包含从网络收集的 13,000 多张面部图像,每张图片标注有人物名称,共有 1680 人,这些图片均由 Viola – Jones 面部...

    LFW(Labeled faces in the wild).tar

    face recognition验证集原始数据

    nyu-depth-v2_labeled.mat-云盘提取.txt

    MIT fast-depth论文所用的数据集nyu-depth-v2_labled.mat。文件2.77G,由于上传限制 可自行云盘提取。友情提示:如果部署到TX1或TX2上,还请考虑磁盘空间。

    nyu_depth_v2_labeled.mat

    nyu_depth_v2_labeled.mat

    nyu-depth-v2_labeled.mat百度网盘.txt

    MIT fast-depth论文所用的数据集nyu-depth-v2_labled.mat。文件2.77G,百度网盘自己下载,永久链接

    Multi-labeled Regularized Marching Tetrahedra Method

    ### Multi-labeled Regularized Marching Tetrahedra Method for Implicit Geological Modeling #### 概述 在地质科学领域,对复杂的地质结构进行精确建模是一项挑战性的任务。传统的单地质界面等值面提取方法在...

    LFW(Labeled Faces in the Wild) 人脸识别数据集-数据集

    LFW,全称为"Labeled Faces in the Wild",是一个广泛使用的公开人脸识别数据集,由美国马萨诸塞大学阿默斯特分校的Gary B. Huang等人于2007年发布。这个数据集的设计目的是推动人脸识别技术在真实世界复杂背景下的...

    2019-ICLR-DEEP GENERATIVE MODELS FOR GENERATING LABELED GRAPHS-R

    在ICLR 2019会议上发表的"2019-ICLR-DEEP GENERATIVE MODELS FOR GENERATING LABELED GRAPHS-R"研究论文中,作者探讨了深度生成模型在生成带标签图(labeled graphs)中的应用。这篇论文主要关注的是如何利用生成...

    Labeled-LDA-Python:用Python实现L-LDA模型(标签潜在Dirichlet分配模型)

    用Python实现L-LDA模型(标签潜在Dirichlet分配模型) 参考: 标记的LDA:多标签语料库中信用归因的受监管主题模型Daniel Ramage ... 文本分析的参数估计,Gregor Heinrich。 潜在的Dirichlet分配,David M....

    grunt-labeled-merge

    grunt-labeled-merge 合并文件夹而不覆盖文件。 入门 这个插件需要 Grunt ~0.4.5 如果您以前没有使用过 ,请务必查看指南,因为它解释了如何创建以及安装和使用 Grunt 插件。 熟悉该过程后,您可以使用以下命令...

    NX二次开发UF-DISP-labeled-conehead 函数介绍

    NX二次开发UF_DISP_labeled_conehead 函数介绍,Ufun提供了一系列丰富的 API 函数,可以帮助用户实现自动化、定制化和扩展 NX 软件的功能。无论您是从事机械设计、制造、模具设计、逆向工程、CAE 分析等领域的专业...

    manually_labeled_faces_and_mask-weared_faces_datas_face_mask_d

    manually_labeled_faces_and_mask-weared_faces_datas_face_mask_dataset

    Labeled Faces in the Wild 数据集数据集

    该数据集用于进行无限制的人脸识别,包含 13000 张从互联网上获取的人脸图像,每张图片都标有该人的姓名,其中有 1680 个人的有超过2张图像。这些人脸图片均通过 Viola-Jones 人脸检测算法从互联网上检测到。...

    flow_labeled.rar

    CICIDS2017数据集,包含12种网络攻击。不是pcap包,是已经提取好的csv文件,文件名就是攻击类型,里面每一行代表一个流,每个流有1600位,都是16进制转换完成之后的10进制数,范围0-255,符合图像处理的范围,可用于...

    Labeled Fishes in the Wild 数据集数据集

    Labeled Fishes in the Wild 为鱼类图像数据集,图像中包含鱼类、无脊椎动物和河床,通过部署在远程操作潜水器上的渔业统计摄像系统拍摄得到的。鱼类位置数据被包括在相应的数据文件中( dat,vec 和 info),标注了...

Global site tag (gtag.js) - Google Analytics