Re: Storing units in the database

From: mAsterdam <mAsterdam_at_vrijdag.org>
Date: Sun, 17 Jul 2005 18:21:16 +0200
Message-ID: <42da857e$0$54675$e4fe514c_at_news.xs4all.nl>


Drago Ganic wrote:
> Marshall wrote:
>> 4) define a type m
>> 5) define a type m^2
>> 6) define an operation * on m that yields m^2
>
> Of course this is doable. But the question is: are types "m^2", "m^3" a good
> and practical approach ? I don't think so. There are algebraically
> relationships between them. How would you relate the types "m", "m^2",
> "m^3"? How would we handle Kilo, Mega etc ?
>
> I believe, as Mikito, this approach is not practical. It's not done in
> physics that way. There are no types in physics.

When physicists start checking dimensions and units, to my programmer eyes it looks very much like type checking - but better.

> Instead we use algebra on
> "symbols". There are no symbols in mainstream programming languages and
> database systems and that's not good.

Heh. 'mainstream' almost tautologices this statement. BASIC stood for Beginners Allpurpose *Symbolic* Instruction Code. Both Prolog and LISP have strong symbolic underpinnings IMHO. Received on Sun Jul 17 2005 - 18:21:16 CEST

Original text of this message