"Strong typing vs. strong testing"

rustom rustompmody at gmail.com
Wed Sep 29 08:43:13 CEST 2010


On Sep 29, 5:32 am, Chris Rebert <c... at rebertia.com> wrote:
> On Tue, Sep 28, 2010 at 2:55 AM, Malcolm McLean
>
>
>
> <malcolm.mcle... at btinternet.com> wrote:
> > On Sep 27, 9:29 pm, p... at informatimago.com (Pascal J. Bourguignon)
> > wrote:
> >> On the other hand, with the dynamic typing mindset, you might even wrap
> >> your values (of whatever numerical type) in a symbolic expression
> >> mentionning the unit and perhaps other meta data, so that when the other
> >> module receives it, it may notice (dynamically) that two values are not
> >> of the same unit, but if compatible, it could (dynamically) convert into
> >> the expected unit.  Mission saved!
>
> > I'd like to design a language like this. If you add a quantity in
> > inches to a quantity in centimetres you get a quantity in (say)
> > metres. If you multiply them together you get an area, if you divide
> > them you get a dimeionless scalar. If you divide a quantity in metres
> > by a quantity in seconds you get a velocity, if you try to subtract
> > them you get an error.
>
> Sounds just like Frink:http://futureboy.us/frinkdocs/http://en.wikipedia.org/wiki/Frink

A currently developed language with units is curl: see
http://developers.curl.com/userdocs/docs/en/dguide/quantities-basic.html



More information about the Python-list mailing list