+1 .. I adopted the same strategy in a json serialization library (sjson) which I wrote long back .. good to merge ..