rename result -> scalar_result - to avoid R swig typemap 'result' name clash