Article View: comp.lang.misc
Article #239Re: Fortran90 and Arrays
From: Stephen P Spackman
Date: Thu, 16 Apr 1992 16:11
Date: Thu, 16 Apr 1992 16:11
47 lines
3094 bytes
3094 bytes
In article <id.HHXO.DK9@ferranti.com> peter@ferranti.com (Peter da Silva) writes: |No, because one supports the operation "extract X co-ordinate" and the |other supports the operation "extract distance from origin". You can |convert one to the other, and this might be a transparent operation |(apart from considerations such as execution speed), but they are not |the same type. If it's transparent then I can't accept this explanation. But I don't have a better one to offer; I just don't know how to think about this case yet. [string comparison uses numeric char order] |Right, so you have a non-portable (that is, dependent on undefined |behaviour) routine. In general you want to avoid this, so you hide |this sort of code behind a subroutine interface. At least if you're |smart you do. But the *compiler* is justified in doing it, as is the library writer (assuming that se knows what the character code is). I stressed the word LEGITIMATE. The caller doesn't know, the routine does, by hypothesis. |C is, by the way, not a good language for illustrating types because |issues of type, machine type, storage class, and even scope are all |muddied (for example, the same keyword is used to define static storage |class and file scope). All you hot compiler hackers, come out with some |good compilers for your language I can cheaply bootstrap and I'll dump |C like a hot potato. Workin' on it. But C is a good medium for discussing *implementations* even if it's a lousy source language, precisely because the grunge shows. [high tech data selection] |Tough to do in C. Impossible to do portably. But sounds like a good way |to do things in a higher level language. In C you would have to create |a set of accessor macros that did appropriate tests and coercions, and |fix the implementation up for each new platform (for example, on the 286 |it's very easy for a string to compare numerically less than 0). Seriously trying to meet your challenge, you understand. I don't want to have to write Mythos in C.... Portability isn't a problem either, unless your code generator, God forbid, is hand-coded.... ---------------------------------------------------------------------- stephen p spackman Center for Information and Language Studies stephen@estragon.uchicago.edu University of Chicago ----------------------------------------------------------------------
Technical Details
Message-ID:
<STEPHEN.92Apr16111200@estragon.uchicago.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!uchinews!tira!stephenReferences:
<STEPHEN.92Apr11201347@estragon.uchicago.edu> <id.OCVO.D6A@ferranti.com> <STEPHEN.92Apr14162524@estragon.uchicago.edu> <id.HHXO.DK9@ferranti.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!uchinews!tira!stephen From: stephen@estragon.uchicago.edu (Stephen P Spackman) Newsgroups: comp.lang.misc Subject: Re: Fortran90 and Arrays Message-ID: <STEPHEN.92Apr16111200@estragon.uchicago.edu> Date: 16 Apr 92 16:11:52 GMT References: <STEPHEN.92Apr11201347@estragon.uchicago.edu> <id.OCVO.D6A@ferranti.com> <STEPHEN.92Apr14162524@estragon.uchicago.edu> <id.HHXO.DK9@ferranti.com> Sender: news@uchinews.uchicago.edu (News System) Organization: University of Chicago CILS Lines: 47 In-Reply-To: peter@ferranti.com's message of 15 Apr 92 18:28:30 GMT