summary refs log tree commit diff
path: root/src/test/auxiliary/cci_class_6.rs
blob: ed52788440f90684b4799b1c126a46360c82c991 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
mod kitties {

class cat<U> {
  priv {
    let mut info : ~[U];
    let mut meows : uint;
  }

  let how_hungry : int;

  new(in_x : uint, in_y : int, -in_info: ~[U])
    { self.meows = in_x; self.how_hungry = in_y;
      self.info <- in_info; }

  fn speak<T>(stuff: ~[T]) {
    self.meows += stuff.len();
  }
  fn meow_count() -> uint { self.meows }
}

}