Re: New Book: The School of Niklaus Wirth

"Joachim Durchholz" <joachim_d@gmx.de>
11 Nov 2000 10:07:11 -0500

          From comp.compilers

Related articles
[3 earlier articles]
Re: New Book: The School of Niklaus Wirth mikael@pobox.com (Mikael Lyngvig) (2000-11-05)
Re: Re: New Book: The School of Niklaus Wirth ollanes@pobox.com (Orlando Llanes) (2000-11-05)
Re: New Book: The School of Niklaus Wirth arargh@enteract.com (2000-11-07)
Re: New Book: The School of Niklaus Wirth gkt37@dial.pipex.com (jt) (2000-11-07)
Re: New Book: The School of Niklaus Wirth vbdis@aol.com (2000-11-09)
Re: New Book: The School of Niklaus Wirth djg@argus.vki.bke.hu (Gabor DEAK JAHN) (2000-11-11)
Re: New Book: The School of Niklaus Wirth joachim_d@gmx.de (Joachim Durchholz) (2000-11-11)
Re: New Book: The School of Niklaus Wirth guerby@acm.org (Laurent Guerby) (2000-11-14)
Re: New Book: The School of Niklaus Wirth vbdis@aol.com (2000-11-14)
Re: New Book: The School of Niklaus Wirth genew@shuswap.net (2000-11-14)
Re: New Book: The School of Niklaus Wirth gdemont@my-deja.com (2000-11-16)
Re: New Book: The School of Niklaus Wirth jerrold.leichter@smarts.com (Jerry Leichter) (2000-11-17)
Re: New Book: The School of Niklaus Wirth fjh@cs.mu.OZ.AU (2000-11-19)
[4 later articles]
| List of all articles for this month |
From: "Joachim Durchholz" <joachim_d@gmx.de>
Newsgroups: comp.compilers
Date: 11 Nov 2000 10:07:11 -0500
Organization: Compilers Central
References: 00-11-046 00-11-068
Keywords: C++, Pascal, design
Posted-Date: 11 Nov 2000 10:07:11 EST

VBDis <vbdis@aol.com> wrote:
>
> In D4 overloaded procedures have been introduced. I cannot see any
> reason, why a compiler should not allow for procedures of the same
> name, but with different argument types.


There's nothing wrong with that in itself.
However, in C++ you have virtual functions (called dynamic dispatch or
late binding in other terminologies); these have a slightly different
semantics, so programmers tend to get it mixed up.
The difference is this: For a call to an overloaded function, the
function to actually execute is determined from the static types of the
arguments. For a dynamically dispatched function, the function to
actually execute is determined from the dynamic, run-time type of the
arguments.
E.g. a call like 'foo.bar(goo)' will select the function using the
run-time type of the value in 'foo' and the compile-time type of 'goo' -
and it's easy to mix these up when programming in the trenches.


> The original
> Pascal language was designed to *teach* programming, not as a vehicle
> to create meaningful programs at all. What's a programming language
> worth, which has no interface to external (OS, API, library...)
> procedures, no dynamic memory allocation, or (finally) no objects?


I agree with your point, but I have a minor correction to make: Standard
Pascal does indeed have dynamic memory allocation. The routines are
called 'new' and 'dispose'.


Regards,
Joachim


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.