Either way, I was pointed at this post this morning about The Cardinality of a Fluent Interface. Again, I wasn't entirely sure I agreed but I was sufficently intrigued to start hacking around.
My first attempt yielded something surprisingly elegant (despite using a couple of mildly egregious hacks such as abusing an overload of the concatenation operator) which allowed you to do things like
one.hundred
twenty.two
A slight bit of hackery later and it could also do
six.hundred.and.fifty
Making it do
four.point.zero
point.five
three.point.one.four
one.nine.zero.four
Required changing the object from the oddly satisfying bless scalar to a more complicated blessed hash and the internals got a lot uglier. I was initially skeptical that I could make it do both nine.point.five.five - which is arguably the correct english way to say it - and nine.point.fifty.five - which is semantically also correct (albeit clumsy and ugly) and useful for currency - but then I suddenly had a flash of inspiration and hacked in the two line change. Currently it's labouring under the name Acme::Numbers and not on CPAN but feel free to have a look and suggest new test case.
