Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

quidity (1296)

  (email not shown publicly)

A relapsing reformed physicist.

Journal of quidity (1296)

Sunday January 20, 2002
07:04 PM


[ #2280 ]

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.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.