Sick

quidity on 2002-01-21T00:04:50

Sometimes I like to make perl make it easy to do something, so that my modules present a simple interface to some complicated underlying weirdness. Q::E was fun because I was trying to make the workings of the module so opaque that the only `extra' code in any program using it was the

entangle()
call. I liked P::MPI::simple because it hid the complex calls to a non-perly C library behind a nice and hopefully obvious interface.

I'm currently trying to make perl have typing as strong as an IRON FIST, in terms of physical units that is, but have found that I can't make this work entirely transparently because of bugs in perl. In my quest to get "the next best thing" I've hit upon a really sick and twisted set of underlying code (scaffolding) which will hold up a fairly nice outer layer. I'm currently using a tempory tied scalar being returned by an lvalue method as my means of checking the type of an assignment, while overloading the object you call the method on so that types propagate through expressions. This allows:

$force->set = $mass * $acceleration

to work while:

$force->set = $volume * $speed

explodes in a million pieces (as it should).

Sometimes, it seems, you have to be sick to be simple.