tl-lang 0.4.8

A differentiable programming language with tensor support for machine learning
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
fn main() {
    let mut map = HashMap::new();
    map.insert(1, 10);
    map.insert(2, 20);
    
    let entries = map.entries();
    assert(entries.len() == 2, "entries.len() == 2");
    
    let entry0 = entries.get(0).unwrap();
    let entry1 = entries.get(1).unwrap();
    
    // Hash maps are unordered, so we check if the sum matches
    assert((entry0.0 + entry1.0) == 3, "sum matches");
    assert((entry0.1 + entry1.1) == 30, "sum values matches");
    
    print("HashMap::entries OK\n");
}