Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template debug_print!(T:Type)
- function(val: ref T){
- @if (compiler.is_struct(T)){
- puts(@compiler.get_type_name(T));
- puts("{");
- @for ( field in T.fields ){
- puts("var ");
- puts(@field.name);
- puts(": ");
- puts(@compiler.get_type_name(field.type));
- puts(" = ");
- debug_print!(@field.type)(val.@field);
- puts(";");
- }
- puts("}");
- }else{
- ...
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement