Path: utzoo!attcan!uunet!sco!seanf From: seanf@sco.COM (Sean Fagan) Newsgroups: comp.misc Subject: Re: COmputer follies Keywords: FORTRAN Message-ID: <1228@scolex> Date: 12 Sep 88 05:31:06 GMT Reply-To: seanf@sco.COM (Sean Fagan) Organization: The Santa Cruz Operation, Inc. Lines: 21 I don't know if this one exactly fits in here, but it's funny anyway (I think it is). One student at Cal State Northridge, after taking a class in Pascal (and finding out about local variables, parameters, and their place on the stack) then took a class in FORTRAN. One of the programs he ended up writing had a routine that squared up it's parameter (I don't know why they just didn't use inline code); he figured that, since the parameter was on the stack, and local variables would also be on the stack, he would save time by doing something like: 'INTEGER SQUARE(x); x=x*x; RETURN x' (formatted properly, of course). Then, in his program, he printed out something like 'SQUARE(5)'. Unfortunately, he was on a CDC Cyber, which doesn't have a stack, and very seriously believes that if you modify a parameter to a function, that's what you want to do. He ended up asking the student assistant on duty (me) why his program was printing: 'PRINT *,5,SQUARE(5)' as '25 25' (or something like that)... Well, I thought it was funny. -- Sean Eric Fagan | "Joy is in the ears that hear, not in the mouth that speaks" seanf@sco.UUCP | -- Saltheart Foamfollower (S. R. Donaldson) (408) 458-1422 | Any opinions expressed are my own, not my employers'.