Changes between Version 2 and Version 3 of TypeInference
- Timestamp:
- 07/23/09 20:25:50 (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TypeInference
v2 v3 1 = Introduction = 2 1 3 Although you can explicitly declare the type of a local variable, you don't have to: 2 4 {{{ … … 36 38 }}} 37 39 40 = Generics = 41 42 Type inference also occurs for the types of generic lists, sets and dictionaries: 43 {{{ 44 names = ['foo', 'bar'] # List<of String> 45 numbers = {1, 2, 3} # Set<of int> 46 shapes = {'circle': Circle(), 'square': Square()} # Dictionary<of String, Shape> 47 }}} 48 49 = If Expressions = 50 51 If-expressions are typed based on their two possible expression results: 52 53 TODO 54 55 = Greatest Common Denominator = 56 57 TODO 58 59 = See Also = 38 60 39 61 See also: AdditionalDoc, TypesOverview