nebulou... / gmail.com wrote:
> On Oct 8, 4:14 am, James Kanze <james.ka... / gmail.com> wrote:
> > On Oct 8, 6:58 am, bbo... / gmail.com wrote:

> > > On Oct 7, 2:59 pm, Jerry Coffin <jcof... / taeus.com> wrote:
> > > > 4.7.3.2. Name Replacement (call by name)
> > > > Any formal parameter not quoted in the value list is replaced,
> > > > throughout the procedure body, by the corresponding actual parameter,
> > > > after enclosing this latter in parentheses wherever syntactically
> > > > possible. Possible conflicts between identifiers inserted through this
> > > > process and other identifiers already present within the procedure will
> > > > be avoided by suitable systematic changes of the formal or local
> > > > identifiers involved.
> > > This sounds rather like macro expansion as found in languages ranging
> > > from TeX to various flavors of shell and make.

> > Not really. [snip loads]

> You seem to be meaning to disagree with me,

Yes and no.  Algol's name replacement is definitly different
than the usual macro replacement in shells, make and TeX,
since the argument gets expanded each time it is used, and
not once when the function is called.  On the other hand,
such languages often do have the capacity to delay
expansion; they also have the capability of treating any
data string as part of the program, so you can pass an
argument as a string, and then execute it multiple times in
a function.  In short, you can easily simulate Algol's name
replacement in such languages.

Of course, if you pass a functional object in C++, you can
also get much of the same effect as well.

--
James Kanze (GABI Software)            mailto:james.kanze / gmail.com
Conseils en informatique orient˝Ă objet/
                   Beratung in objektorientierter Datenverarbeitung
9 place S˝╬ard, 78210 St.-Cyr-l'ą╬cole, France, +33 (0)1 30 23 00 34