Code Comments
Programming Forum and web based access to our favorite programming groups.Hello, I'm in the habit of putting spaces between my ENDs and ELSEs, e.g. END DO END FUNCTION END TYPE END WHERE and ELSE IF ELSE WHERE etc. I don't use the WHERE construct too much (some compilers I used in the past had, uh, issues with it, e.g. Signal: Bus error in Codegen Driver phase. Error: Signal Bus error in phase Codegen Driver -- processing aborted but I digress....) I now discover that the portable form is ELSEWHERE not ELSE WHERE I googled clf about this and got the thread asking the exact same question, http://tinyurl.com/3luxw but I found the responses a bit lacking. Although the English spelling of th e *word* is "elsewhere", I don't really understand why that would translate into the spe lling of the Fortran *statement* ELSEWHERE - it seems counter-intuitive considering the o ther ELSE used in Fortran, ELSE IF. And to say nothing about the END statements for other c onstructs (IF, SELECT, and WHERE itself). All my f90/95 texts are silent on the reasoning. cheers, paulv -- Paul van Delst CIMSS @ NOAA/NCEP/EMC
Post Follow-up to this messagePaul Van Delst <paul.vandelst@noaa.gov> writes: > but I found the responses a bit lacking. Although the English spelling > of the *word* is "elsewhere", I don't really understand why that would > translate into the spelling of the Fortran *statement* ELSEWHERE - it > seems counter-intuitive considering the other ELSE used in Fortran, > ELSE IF. And to say nothing about the END statements for other > constructs (IF, SELECT, and WHERE itself). All my f90/95 texts are > silent on the reasoning. I don't see how much more can be said about the reasoning. Sounds to me like you just quoted it. Namely, that the English word is "elsewhere" and that is exactly what the statement means. That situation is different from all the other cases that you cite. There is no English word "elseif"; the Fortran construct is derived from the 2 separate words "else" and "if". Note also that at least the simple elsewhere (i.e. with no condition attached) is not at all equivalentto embedding another "where" construct inside of the first one as the spelling "else where" might imply. Thus the English meaning of the 2 words is wrong in at least that case, while that of the one word is correct. One can, of course, argue the point forever. People certainly have. I'm pretty sure that I recall a proposal at J3 to allow "elsewhere" to be spelled "else where". Obviously, it didn't pass... um... maybe I better check the f2003 document before posting that statement.... Good thing I checked, as apparently it did pass in f2003. Ok, then I have to change the exact sense of the next thing I was going to say, but the essense is still there. Though I don't recall the exact vote (obviously, since I misremembered the outcome), I'm sure that it was not unanimous. Anyway, you have described the rationale for what was apparently the minority opinion in the vote on allowing "else where" in f2003. As for why the blank was disallowed in the first place in f95, I'd posit either the same reason... or perhaps a more severe form of what amounts to the same reason: since the English word is "elsewhere", it might not even have occurred to the authors of the original feature that someone might want to spell it with a blank. -- Richard Maine | Good judgment comes from experience; email: my first.last at org.domain | experience comes from bad judgment. org: nasa, domain: gov | -- Mark Twain
Post Follow-up to this messageRichard E Maine wrote: > Paul Van Delst <paul.vandelst@noaa.gov> writes: > > > > > I don't see how much more can be said about the reasoning. Sounds to > me like you just quoted it. Namely, that the English word is > "elsewhere" and that is exactly what the statement means. That > situation is different from all the other cases that you cite. There > is no English word "elseif"; the Fortran construct is derived from the > 2 separate words "else" and "if". > > Note also that at least the simple elsewhere (i.e. with no condition > attached) is not at all equivalentto embedding another "where" construct > inside of the first one as the spelling "else where" might imply. > Thus the English meaning of the 2 words is wrong in at least that case, > while that of the one word is correct. > > One can, of course, argue the point forever. Yeah, I know. :o) It just seems to me that, for a programming language, if you learn a couple of rules (e.g. ELSE<space>IF, END<space>IF, END<space>WHERE etc), the n the rest should be consistent with those (such as ELSE<space>WHERE). Particularly if English was not one's native language. English is my first language and I still assumed the form was ELSE<space>WHERE. I guess I just find the exception jarring - more like a spoken language than a computer-y one. cheers, paulv -- Paul van Delst CIMSS @ NOAA/NCEP/EMC
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.