Advertisement
snake5

SGScript - inheritance/duck typing v2 (data/code separation)

Apr 30th, 2014
412
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. test =
  2. {
  3.     num = 5,
  4.     name = "wat",
  5. };
  6.  
  7. function Test_Incr(){ this.num++; }
  8. function Test_Name( x ){ this.name = x; }
  9.  
  10. test!Test_Incr();
  11. test!Test_Name( "dat" );
  12.  
  13. printvar( test );
  14.  
  15.  
  16. ///// output /////
  17. object (00486AB8) [4] dict (2)
  18. {
  19.   num = int (6)
  20.   name = string [3] "dat"
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement