[eeps] Multi-Parameter Typechecking BIFs

Bjorn Gustavsson bgustavsson@REDACTED
Thu Feb 26 07:53:13 CET 2009


On Thu, Feb 26, 2009 at 12:52 AM, Richard O'Keefe <ok@REDACTED> wrote:
> Let's take a look at e3d_vec.erl

You noted that several functions in e3d_vec do not check the type of
all of their arguments
and assumed it was an oversight.

It was not. In all functions that I have implemented in e3d_vec (which
is most of them),
I only added enough type checks to make sure that the compiler would
use the specially
optimized floating point instructions. For instance, when adding two
vectors, it is enough
to type-check the first vector, since the compiler will automatically
add conversion code to
convert the components of the second vector to floats if necessary.

/Bjorn
-- 
Björn Gustavsson, Erlang/OTP, Ericsson AB



More information about the eeps mailing list