You are here: Re: which language allows you to change an argument's value? « PHP Programming Language « IT news, forums, messages
Re: which language allows you to change an argument's value?

Posted by Alf P. Steinbach on 10/07/07 10:10

* James Kanze:
> On Oct 4, 12:35 am, "John W. Kennedy" <jwke...@attglobal.net> wrote:
>> Dennis Lee Bieber wrote:
>>> On Mon, 01 Oct 2007 01:53:47 GMT, Roedy Green
>>> <see_webs...@mindprod.com.invalid> declaimed the following in
>>> comp.lang.python:
>
>>>> Seem to me you could in FORTRAN and Pascal, and maybe even Algol. It
>>>> has been a while.
>
>>> Everything in classic FORTRAN is a passed as a reference -- even
>>> constant arguments are passed as a reference to the memory location
>>> containing that constant (which is why it was possible in very early
>>> FORTRANs to have "a = 1 + 1" yield something other than "2" if preceded
>>> by, say, "call mutate(1)" where mutate looks like:
>
>>> subroutine mutate(arg)
>>> arg = arg * 2
>>> end
>>> )
>
>> However, some implementations passed /and returned/ elementary
>> arguments by value, as Ada does. (The object code was
>> typically faster that way, and FORTRAN semantics were such
>> that the difference was almost impossible to observe.)
>
> The Fortran standard is carefully worded to allow either pass by
> reference, or copy-in, copy-out. IIRC, IBM's Fortran-H used
> copy-in/copy-out, but most others used call by reference.
>
> Straight copy was never allowed by the standard, and I've never
> heard of a pre-standard implementation which used it either.

This is all to simple. Please discuss Algol pass-by-name. Much more
interesting, and a good candidate for inclusion in C++ -- at least, if
we're going to achieve the goal of PL/1-killer! :-)

Cheers,

- Alf (off-topic)

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация