SHARE
TWEET

Untitled

tinyevil Jan 15th, 2019 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. template debug_print!(T:Type)
  2. function(val: ref T){
  3.     @if (compiler.is_struct(T)){
  4.         puts(@compiler.get_type_name(T));
  5.         puts("{");
  6.         @for ( field in T.fields ){
  7.             puts("var ");
  8.             puts(@field.name);
  9.             puts(": ");
  10.             puts(@compiler.get_type_name(field.type));
  11.             puts(" = ");
  12.             debug_print!(@field.type)(val.@field);
  13.             puts(";");
  14.         }
  15.         puts("}");
  16.     }else{
  17.         ...
  18.     }
  19. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top