New paste Repaste Download
// Like trait in Rust
aspect Bird {
  void fly(int km);
  void layAnEgg();
}
struct Turkey {
  Colour colour = BLACK;
  Genre genre;
  weight float;
  long distance = 0;
  long eggs = 0;
}
def Bird: Turkey {
  void fly(int km) {
    distance += km;
  }
  
  void layAnEgg() {
    eggs += 1;
  }
}
Filename: None. Size: 322b. View raw, , hex, or download this file.

This paste expires on 2025-03-07 19:43:07.375737. Pasted through web.