An interview with Larry Wall (LinuxVoice)
An interview with Larry Wall (LinuxVoice)
Posted Jul 19, 2015 9:11 UTC (Sun) by Wol (subscriber, #4433)In reply to: An interview with Larry Wall (LinuxVoice) by raiph
Parent article: An interview with Larry Wall (LinuxVoice)
The Pr1me CPU was capable of doing BCD arithmetic, and had a load of microcode specifically to optimise all this sort of stuff. The Pick database was designed to store integers, and to store the mantissa in the data definition, not the data itself. As an example, let's store some price information in pounds in Pick - you'd put "199" in the data field, and "MD2" in the definition ("masked decimal 2"). That converts data at display time to 2dp, ie 1.99
So when you as the programmer are doing the maths, you have to be wary of multiplying MD-type fields, because MD2 * MD2 is, of course, MD4 and if you don't "correct" it to whatever datatype you're storing the result as, you can get some right funnies ...
Cheers,
Wol
Posted Jul 19, 2015 22:43 UTC (Sun)
by raiph (guest, #89283)
[Link] (1 responses)
Gotchya.
Iirc pick doesn't have (much of) a type system and you're describing the kind of problem that type systems address.
I don't see a parallel with anything Perl 6 specific atm.
Thanks for following up. :)
Posted Jul 20, 2015 14:34 UTC (Mon)
by Wol (subscriber, #4433)
[Link]
imho that is both a great strength, and a massive weakness. Everything is a string. Works great (it really does). But the fact that all of your definitions are DEscriptive, rather than PREscriptive, *can* (not *is*) be a nightmare when you really really want to be certain something is, say, a number.
But on the other hand, it does make it easy to store things like "dead" or "unknown" in an age field :-)
Cheers,
An interview with Larry Wall (LinuxVoice)
> you have to be wary of multiplying [such] fields
An interview with Larry Wall (LinuxVoice)
Wol