set g2_trace_ftions 0 # This example shows two ways to add methods to a class. class Animal { ctor ( ) { } @ // First way: just write the method in output mode, between // two 'at' signs. char* get_name() { return "Fido"; } @ // Second way: in TCL mode, use the procedure 'f'. f :pvc void talk(num) { // Abstract function with 'int num' argument } } array set sounds { Cat miowwwwwww Dog woofffffff Snake hisssssss } foreach animal { Cat Dog Snake } { class $animal : public Animal { ctor i() {@ printf("Creating a new \"$(animal)\"\n"); @} dtor () { } f :vc void talk(num) {@ for(int i= 0; i