Wiki

Changes between Version 2 and Version 3 of TypeInference

Show
Ignore:
Timestamp:
07/23/09 20:25:50 (15 years ago)
Author:
Chuck
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TypeInference

    v2 v3  
     1= Introduction = 
     2 
    13Although you can explicitly declare the type of a local variable, you don't have to: 
    24{{{ 
     
    3638}}} 
    3739 
     40= Generics = 
     41 
     42Type 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 
     51If-expressions are typed based on their two possible expression results: 
     52 
     53TODO 
     54 
     55= Greatest Common Denominator = 
     56 
     57TODO 
     58 
     59= See Also = 
    3860 
    3961See also: AdditionalDoc, TypesOverview