comp.lang.ada
 help / color / mirror / Atom feed
From: kcline17@hotmail.com (Kevin Cline)
Subject: Re: Dimension checking was RE: Why is Ada NOT a good choice for a beginner to programming?
Date: 13 Jan 2003 15:20:20 -0800
Date: 2003-01-13T23:20:20+00:00	[thread overview]
Message-ID: <ba162549.0301131520.7798bc31@posting.google.com> (raw)
In-Reply-To: mailman.1042310041.30777.comp.lang.ada@ada.eu.org

"Robert C. Leif" <rleif@rleif.com> wrote in message news:<mailman.1042310041.30777.comp.lang.ada@ada.eu.org>...
> An obvious fix, which was discussed at SIGAda 2002, is to develop a 
> means
> (Pragma?) to tell the compiler to only check the dimensionality at 
> compile
> time. This could be in the form of a compile time assertion.
> Bob Leif

I don't know what the proposal encompassed, but it's hard for me to imagine
an "obvious" fix to this problem.  With physical dimensions we have 
   Qty<L1,M1,T1,...> * Qty<L2,M2,T2,...> => Qty<L1+L2,M1+M2,T1+T2,...>

where L1,M1,T1,L2,M2,T2 are the dimensions of length, mass, time, etc.
However, there are many systems of physical units in use in different
problem domains.  For example, it is often convenient to make length
and time interchangable.

And in matrix algebra we have:
   innerProduct(Matrix<M,N>, Matrix<N,P>) => Matrix<M,P>

Any solution adopted should be able to correctly model 
both of these type systems.



  parent reply	other threads:[~2003-01-13 23:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-10  6:38 Why is Ada NOT a good choice for a beginner to programming? Grein, Christoph
2003-01-10  8:21 ` Hyman Rosen
2003-01-10 15:51 ` Kevin Cline
2003-01-11 18:32   ` Dimension checking was " Robert C. Leif
2003-01-13 17:34     ` Stephen Leake
2003-01-13 23:20     ` Kevin Cline [this message]
2003-01-10 19:00 ` Kevin Cline
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox