I'm trying to redefine standard data types to use only inside macro, and then restore them back:
macro my? name
struc db? arg
label .
match ?, arg
rb 1
else match n =dup? ?, arg
rb n
else match n =dup? (?), arg
rb n
else
err "Invalid element data type definition"
end match
.__length = $ - .
.__size = 1
end struc
macro end?.my?
end struc
. . .
purge db?
;restore db
end macro
struc my
. . .
end macro
however, purge or restore doesn't seem to undefine struc, because when I do
my OWN
a db ?
end my
b db 1
some OWN a:3
I get custom error "Invalid element data type definition" for `b db 1`. Looks like `end my` doesn't restore the symbol.