· page No.
1 type Safelanguage
The main content of this page is that the Swift language is a safe programming language for " type checking " . This means that the lvalue and rvalue types of an assignment statement are consistent, and the Lvalue declaration is a string variable, so the right value of the equal sign is the one that is caused by the double-argument. Instead of shaping or floating-point data.
The compiler checks the left and right values of an assignment statement when compiling code. Assume that the type does not match. Compiler error, that is, to do data security checks to ensure consistency of data.
2 Type Inferencelanguage
Swift the consistency of data types is checked at compile time, but does not mean that variables or constants must be typed when defining constants and variables. Can not describe the type, because Swift has a mechanism called type inference language.
Swift the compiler of a language automatically determines whether the constant or variable should belong to that data type, based on the initialization assignment statement of the constant or variable.
eg1:let S1 = " www.chinagame.me "
This statement , Swift , is based on the Lvalue "www.chinagame.me" of an assignment statement and determines the type of the S1 constant is string .
this Swift It is not necessary for a program developer to define as follows S1 constant.
Let s1:string = " www.chinagame.me "
under the type inference mechanism
Let s1 = " www.chinagame.me "
and let s1:string = "www.chinagame.me" declaration S1 is a constant equivalent.
Key Words: type Check , type safe Languagge , type inference
The note on the Swift Programming Language-page 27th