The special form in which the RHS name is called 'new' creates a fresh, previously unused name.
Unlike other macros, the RHS name of an ident macro is not expanded at the point of definition.
On use, the value of an ident macro is the first name in the chain which is not an ident macro, or which recurs.
1: include "std"; 2: 3: macro oldname is newname; 4: fun oldname(x:int):int = { return x; } 5: print (newname 1); endl; 6: 7: macro proc make_ints () 8: { 9: macro vnew is new; 10: val vnew = vold+1; 11: macro vold = vnew; 12: } 13: 14: val x = 1; 15: 16: macro var vold = x; 17: make_ints; 18: make_ints; 19: make_ints; 20: print vold; endl; 21: