On 2017-05-25, Dennis Lee Bieber <wlfr...@ix.netcom.com> wrote: > On Thu, 25 May 2017 00:34:52 +0100, bartc <b...@freeuk.com> declaimed the > following: > > >>That was quite likely with older Fortrans, where subroutines only >>used pass-by-reference, but which didn't stop you passing references >>to constants that the subroutine could then modify. > > For the most part, Fortran is still pass-by-reference (VMS F77 did > have a "descriptor" for character strings -- it had the address of > the buffer along with a field for the size of the buffer).
When I was in grad school in Computer Science, one of the professors wrote a test question that had multiple correct answers depending on whether parameters were passed by reference, value, name, thunk, whatever. [The parameter passing mechanism and programming language were unspecified.] I wrote that I was assuming pass by value and then provided my solution. He marked it wrong -- not even any partial credit. I went to discuss it with him: he said my answer was wrong because parameters are passed by reference. He had never even heard of any other method! I tried to explain that some languages pass by value, some lanaguages pass by reference, some languages allow the user to specify either, and that there were other methods as well. He failed to comprehend anything other than pass by reference. I tried to explain the other methods, and gave him examples of languages that used them. He again failed to grok any of it and gave me credit for the question just to get rid of me. [I like to think he realized he was in over his head and didn't want to admit the extent of his ignorance]. All of his degrees were in math (I'm pretty sure he had ever _taken_ a CS course in his life). His main programming language was self-modifying CDC-6600 assembly language (he also used FORTRAN occasionally on the 6600). IIRC, his area of speciality was integer division algorothims. They later made him chair of the graduate studies department (or something like that) -- presumably to keep him out of the classroom and away from students. -- Grant Edwards grant.b.edwards Yow! Jesuit priests are at DATING CAREER DIPLOMATS!! gmail.com -- https://mail.python.org/mailman/listinfo/python-list