Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(476)

Side by Side Diff: docs/language/dartLangSpec.tex

Issue 415333003: Clarify that prefixes may not be built-in identifers (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 \documentclass{article} 1 \documentclass{article}
2 \usepackage{epsfig} 2 \usepackage{epsfig}
3 \usepackage{dart} 3 \usepackage{dart}
4 \usepackage{bnf} 4 \usepackage{bnf}
5 \usepackage{hyperref} 5 \usepackage{hyperref}
6 \newcommand{\code}[1]{{\sf #1}} 6 \newcommand{\code}[1]{{\sf #1}}
7 \title{Dart Programming Language Specification \\ 7 \title{Dart Programming Language Specification \\
8 {\large Version 1.6}} 8 {\large Version 1.6}}
9 %\author{The Dart Team} 9 %\author{The Dart Team}
10 \begin{document} 10 \begin{document}
(...skipping 4035 matching lines...) Expand 10 before | Expand all | Expand 10 after
4046 DIGIT 4046 DIGIT
4047 . 4047 .
4048 4048
4049 4049
4050 4050
4051 {\bf qualified:} 4051 {\bf qualified:}
4052 identifier (`{\escapegrammar .}' identifier)? 4052 identifier (`{\escapegrammar .}' identifier)?
4053 . 4053 .
4054 \end{grammar} 4054 \end{grammar}
4055 4055
4056 A built-in identifier is one of the identifiers produced by the production {\em BUILT\_IN\_IDENTIFIER}. It is a compile-time error if a built-in identifier is u sed as the declared name of a class, type parameter or type alias. It is a compi le-time error to use a built-in identifier other than \DYNAMIC{} as a type annot ation. 4056 A built-in identifier is one of the identifiers produced by the production {\em BUILT\_IN\_IDENTIFIER}. It is a compile-time error if a built-in identifier is u sed as the declared name of a prefix, class, type parameter or type alias. It is a compile-time error to use a built-in identifier other than \DYNAMIC{} as a ty pe annotation.
4057 4057
4058 \rationale{ 4058 \rationale{
4059 Built-in identifiers are identifiers that are used as keywords in Dart, but are not reserved words in Javascript. To minimize incompatibilities when porting Jav ascript code to Dart, we do not make these into reserved words. A built-in ident ifier may not be used to name a class or type. In other words, they are treated as reserved words when used as types. This eliminates many confusing situations without causing compatibility problems. After all, a Javascript program has no type declarations or annotations so no clash can occur. Furthermore, types shou ld begin with an uppercase letter (see the appendix) and so no clash should occu r in any Dart user program anyway. 4059 Built-in identifiers are identifiers that are used as keywords in Dart, but are not reserved words in Javascript. To minimize incompatibilities when porting Jav ascript code to Dart, we do not make these into reserved words. A built-in ident ifier may not be used to name a class or type. In other words, they are treated as reserved words when used as types. This eliminates many confusing situations without causing compatibility problems. After all, a Javascript program has no type declarations or annotations so no clash can occur. Furthermore, types shou ld begin with an uppercase letter (see the appendix) and so no clash should occu r in any Dart user program anyway.
4060 } 4060 }
4061 4061
4062 Evaluation of an identifier expression $e$ of the form $id$ proceeds as follows: 4062 Evaluation of an identifier expression $e$ of the form $id$ proceeds as follows:
4063 4063
4064 4064
4065 Let $d$ be the innermost declaration in the enclosing lexical scope whose name i s $id$ or $id=$. If no such declaration exists in the lexical scope, let $d$ be the declaration of the inherited member named $id$ if it exists. 4065 Let $d$ be the innermost declaration in the enclosing lexical scope whose name i s $id$ or $id=$. If no such declaration exists in the lexical scope, let $d$ be the declaration of the inherited member named $id$ if it exists.
4066 %If no such member exists, let $d$ be the declaration of the static member name $id$ declared in a superclass of the current class, if it exists. 4066 %If no such member exists, let $d$ be the declaration of the static member name $id$ declared in a superclass of the current class, if it exists.
(...skipping 1992 matching lines...) Expand 10 before | Expand all | Expand 10 after
6059 \item The names of compile time constant variables never use lower case letters. If they consist of multiple words, those words are separated by underscores. Ex amples: PI, I\_AM\_A\_CONSTANT. 6059 \item The names of compile time constant variables never use lower case letters. If they consist of multiple words, those words are separated by underscores. Ex amples: PI, I\_AM\_A\_CONSTANT.
6060 \item The names of functions (including getters, setters, methods and local or l ibrary functions) and non-constant variables begin with a lowercase letter. If t he name consists of multiple words, each word (except the first) begins with an uppercase letter. No other uppercase letters are used. Examples: camlCase, dar t4TheWorld 6060 \item The names of functions (including getters, setters, methods and local or l ibrary functions) and non-constant variables begin with a lowercase letter. If t he name consists of multiple words, each word (except the first) begins with an uppercase letter. No other uppercase letters are used. Examples: camlCase, dar t4TheWorld
6061 \item The names of types (including classes and type aliases) begin with an uppe r case letter. If the name consists of multiple words, each word begins with an uppercase letter. No other uppercase letters are used. Examples: CamlCase, D art4TheWorld. 6061 \item The names of types (including classes and type aliases) begin with an uppe r case letter. If the name consists of multiple words, each word begins with an uppercase letter. No other uppercase letters are used. Examples: CamlCase, D art4TheWorld.
6062 \item The names of type variables are short (preferably single letter). Examples : T, S, K, V , E. 6062 \item The names of type variables are short (preferably single letter). Examples : T, S, K, V , E.
6063 \item The names of libraries or library prefixes never use upper case letters. I f they consist of multiple words, those words are separated by underscores. Exam ple: my\_favorite\_library. 6063 \item The names of libraries or library prefixes never use upper case letters. I f they consist of multiple words, those words are separated by underscores. Exam ple: my\_favorite\_library.
6064 \end{itemize} 6064 \end{itemize}
6065 } 6065 }
6066 6066
6067 6067
6068 \end{document} 6068 \end{document}
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698