From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,cc4f25d878383cc X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-12-03 06:56:43 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!news.maxwell.syr.edu!howland.erols.net!news-out.worldnet.att.net.MISMATCH!wn3feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!rwcrnsc54.POSTED!not-for-mail From: "Mark Lundquist" Newsgroups: comp.lang.ada References: Subject: Re: Another Idea for Ada 20XX X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Message-ID: NNTP-Posting-Host: x1MO7-377268-Px-45361@rwcrnsc54 X-Complaints-To: abuse@worldnet.att.net X-Trace: rwcrnsc54 1007391403 x1MO7-377268-Px-45361@rwcrnsc54 (Mon, 03 Dec 2001 14:56:43 GMT) NNTP-Posting-Date: Mon, 03 Dec 2001 14:56:43 GMT Organization: AT&T Worldnet Date: Mon, 03 Dec 2001 14:56:43 GMT Xref: archiver1.google.com comp.lang.ada:17339 Date: 2001-12-03T14:56:43+00:00 List-Id: "Gautier Write-only-address" wrote in message news:mailman.1007322723.31592.comp.lang.ada@ada.eu.org... > >From: James Rogers > > >In scientific terms a measurement is done in terms of some unit. > >For instance, distance is in meters, microns, feet or furlongs. > > The overhead is not only computational, I fear: if programmers > are forced to specify the unit of each of their variables > with a possible physical meaning, they just won't program in > Ada... Only if they have to give distance in "furlongs"! :-) But seriously... no, the idea would not "force" programmers to do specify. Units are unlike types in that they are optional (think about it, what units would you give for Pi?). What it would do is make it possible (but not necessary) for you to write a subprogram that takes its inputs in certain units. Callers of the subprogram would then have to supply parameters of a correctly dimensioned type, which might entail a unit conversion. Note that it is probably necessary to provide conversions to and from dimensionlessness, so if the client wants to do everything without units (keeping track of this manually just as we do today), they can still do that (taking their life into their own hands) by applying a conversion at the point of the call to your routine. > > Where is the problem, indeed ? Mixing feets and meters in a > program ? This is more a political or cultural problem, I > wouldn't wish to complicate Ada with it... No, the idea does not complicate Ada with political/cultural problems. I don't Jim's suggestion extends to adding standardized physical units to the language, only the ability to abstract unit relationships. The language would not care (nor do I) whether feet and meters are mixed in a program; the point is that such a mixing (a) cannot be inadvertent, (b) is revealed in the source text, and (c) cannot be a source of errors. Really it would be quite a convenience and a savings of bother for the programmer. I don't know why anyone would not want it (OK, so maybe if I were to actually write enough of a proposal... :-) -- mark