Advertisement
Kiscsirke

Cool initialization test

Apr 3rd, 2013
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. Class Mutual inherits IO {
  2. a : Int <- b;
  3. b : Int <- a;
  4. out() : Object { {
  5. out_int(a);
  6. out_int(b);
  7. out_string("\n");
  8. }};
  9. };
  10.  
  11. Class After inherits IO {
  12. a : Int <- 5;
  13. b : Int <- a;
  14. out() : Object { {
  15. out_int(a);
  16. out_int(b);
  17. out_string("\n");
  18. }};
  19. };
  20.  
  21. Class Before inherits IO{
  22. a : Int <- b;
  23. b : Int <- 5;
  24. out() : Object { {
  25. out_int(a);
  26. out_int(b);
  27. out_string("\n");
  28. }};
  29. };
  30.  
  31. Class Main {
  32. main() : Object {{
  33. (new Mutual).out();
  34. (new After).out();
  35. (new Before).out();
  36. }};
  37. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement