Re: [OT] Commodore 64 BASIC (was: Interesting bug)
From: Keith Thompson (kst-u_at_mib.org)
Date: 04/22/04
- Next message: Alan Balmer: "Re: Rob Pike's simple Include rule"
- Previous message: Chris Sonnack: "Re: [OT] Commodore 64 BASIC v2, again (was: Interesting bug)"
- In reply to: Dan Pop: "Re: [OT] Commodore 64 BASIC (was: Interesting bug)"
- Next in thread: Old Wolf: "Re: [OT] Commodore 64 BASIC (was: Interesting bug)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 22 Apr 2004 20:35:40 GMT
Dan.Pop@cern.ch (Dan Pop) writes:
> In <c681oo$qbq$2@oravannahka.helsinki.fi> Joona I Palaste
> <palaste@cc.helsinki.fi> writes:
> >I have never programmed in Fortran, but I think it was about the same
> >situation with the Fortran version Dan Pop grew up with.
>
> Nope, FORTRAN IV was much better than BASIC and the "new" logical IF
> statements were a great improvement over FORTRAN II's arithmetic IF
> statements (which were gotos with 3 destinations).
>
> Each program unit (main unit, functions and subroutines) had its own
> local variables and it could be made to "see" only the global variables
> it needed to see.
>
> Its main drawbacks, that survived until F90, were the fixed-form line
> format with purely numeric labels (characters beyond column 72 were
> silently ignored, to provide additional fun during debugging) and blanks
> being *completely* ignored in the statement field (starting in column 7),
> except inside "string" literals. Hence the (in)famous typo:
>
> DO 5 I = 1. 5
>
> (the period was supposed to be a comma) that led to the statement being
> parsed as:
>
> DO5I = 1.5
>
> i.e. a loop was replaced by an assignment to a bogus variable and the body
> of the loop was executed once instead of 5 times. This happened in a NASA
> program, but the consequences were minimal (a certain entity was evaluated
> with less precision than intended).
This is a classic bug story, about which a great deal of
misinformation has been propagated over the years. There's a good
explanation of this bug (and the unrelated programming glitch that led
to the loss of the Mariner 1 Venus probe) in an article posted to
comp.lang.fortran back in 1994.
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=CwDIEq.D70%40news.cern.ch
The article was posted by some guy named "Dan Pop".
-- Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst> San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst> Schroedinger does Shakespeare: "To be *and* not to be"
- Next message: Alan Balmer: "Re: Rob Pike's simple Include rule"
- Previous message: Chris Sonnack: "Re: [OT] Commodore 64 BASIC v2, again (was: Interesting bug)"
- In reply to: Dan Pop: "Re: [OT] Commodore 64 BASIC (was: Interesting bug)"
- Next in thread: Old Wolf: "Re: [OT] Commodore 64 BASIC (was: Interesting bug)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|