rewrite Julia and R TypeMapping code,this time it should be correct