Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.compilers > #3503
| Path | csiph.com!weretis.net!feeder6.news.weretis.net!news.misty.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end |
|---|---|
| From | Hans-Peter Diettrich <DrDiettrich1@netscape.net> |
| Newsgroups | comp.compilers |
| Subject | Re: modifying constants in Fortran and elsewhere |
| Date | Sun, 16 Jul 2023 11:56:27 +0200 |
| Organization | Compilers Central |
| Sender | johnl%iecc.com |
| Approved | comp.compilers@iecc.com |
| Message-ID | <23-07-007@comp.compilers> (permalink) |
| References | <23-07-003@comp.compilers> <23-07-006@comp.compilers> |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset="UTF-8" |
| Injection-Info | gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="90854"; mail-complaints-to="abuse@iecc.com" |
| Keywords | code, history, comment |
| Posted-Date | 16 Jul 2023 12:01:13 EDT |
| X-submission-address | compilers@iecc.com |
| X-moderator-address | compilers-request@iecc.com |
| X-FAQ-and-archives | http://compilers.iecc.com |
| In-Reply-To | <23-07-006@comp.compilers> |
| Xref | csiph.com comp.compilers:3503 |
Show key headers only | View raw
On 7/15/23 12:57 PM, Thomas Koenig wrote: > gah4 <gah4@u.washington.edu> schrieb: >> A potential bug since the earliest days of Fortran is passing a >> constant to a subroutine, and then changing the value of the dummy >> argument. > I actually got bitten by that while using a mainframe for scientific > work as a student. It's been a few decades, so I don't recall too > many details. It was difficult to find, but I was paid by the hour, > so I didn't mind too much :-) I remember such a bug in the 80s on the pdp-11/34 of our institute. > Algol 60 tried to define > its argument passing in an elegant way, and accidentally invented call > by name when they meant call by reference. -John] By Name example from the German wikipedia <https://de.wikipedia.org/wiki/Namensparameter> >> A[1] := 10 A[2] := 20 i := 1 x := Funkt (A[i], i) FUNCTION Funkt (a, i) : Real i := i+1 RETURN a END x wird der Wert 20 zugewiesen. Im Werteparameter-Fall wäre x dagegen 10, ebenso bei Referenzparametern. << Returns 20 as ByName while 10 were returned for ByRef. DoDi [Then there's the infamous Knuth Man or Boy program, where even he couldn't figure out what the answer was supposed to be. https://en.wikipedia.org/wiki/Man_or_boy_test -John]
Back to comp.compilers | Previous | Next — Previous in thread | Next in thread | Find similar
modifying constants in Fortran and elsewhere gah4 <gah4@u.washington.edu> - 2023-07-10 19:42 -0700
Re: modifying constants in Fortran and elsewhere Thomas Koenig <tkoenig@netcologne.de> - 2023-07-15 10:57 +0000
Re: modifying constants in Fortran and elsewhere Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2023-07-16 11:56 +0200
Re: modifying constants in Fortran and elsewhere Thomas Koenig <tkoenig@netcologne.de> - 2023-07-16 13:08 +0000
Re: modifying constants in Fortran and elsewhere gah4 <gah4@u.washington.edu> - 2023-07-16 19:09 -0700
Re: modifying constants in Fortran and elsewhere gah4 <gah4@u.washington.edu> - 2023-07-17 10:51 -0700
Re: modifying constants in Fortran and elsewhere gah4 <gah4@u.washington.edu> - 2023-07-16 19:17 -0700
Re: modifying constants in Fortran and elsewhere David Brown <david.brown@hesbynett.no> - 2023-07-17 13:09 +0200
csiph-web