Re: problems with identifiers and keywords...

glen herrmannsfeldt <gah@ugcs.caltech.edu>
5 Dec 2004 21:32:32 -0500

          From comp.compilers

Related articles
[19 earlier articles]
Re: problems with identifiers and keywords... Peter_Flass@Yahoo.com (Peter Flass) (2004-11-20)
Re: problems with identifiers and keywords... genew@mail.ocis.net (Gene Wirchenko) (2004-11-20)
Re: problems with identifiers and keywords... david.thompson1@worldnet.att.net (Dave Thompson) (2004-11-28)
Re: problems with identifiers and keywords... cgweav@aol.com (2004-11-29)
Re: problems with identifiers and keywords... nmm1@cus.cam.ac.uk (2004-12-01)
Re: problems with identifiers and keywords... cdc@maxnet.co.nz (Carl Cerecke) (2004-12-01)
Re: problems with identifiers and keywords... gah@ugcs.caltech.edu (glen herrmannsfeldt) (2004-12-05)
Re: problems with identifiers and keywords... vbdis@aol.com (2004-12-05)
| List of all articles for this month |

From: glen herrmannsfeldt <gah@ugcs.caltech.edu>
Newsgroups: comp.compilers
Date: 5 Dec 2004 21:32:32 -0500
Organization: Comcast Online
References: 04-10-148 04-11-031 04-11-052 04-11-105 04-12-004
Keywords: syntax
Posted-Date: 05 Dec 2004 21:32:32 EST

Nick Maclaren wrote:


(snip regarding naming user supplied functions with the same
name as system library functions in C and Fortran.)


> This has all been standard practice since Fortran 66 - the really old
> lags may be able to confirm whether or not is was before that. Yes, I
> know that some Fortran 66 compilers didn't support program- defined
> functions of the same name as library ones, but that was more for good
> debugging than because the linkers couldn't handle it. Of course,
> SOME linkers couldn't, but most could.


Yes. Fortran 66 also separately defines intrinsic and (system
supplied) basic external functions. There are differences in the way
they can be used. Intrinsic functions were often expanded inline.
The EXTERNAL statement allows user supplied functions to be used
instead of an intrinsic function in a program unit. Basic external
function names and user supplied function names can be used as
arguments to other subroutines or functions, again through the
(different) use of the EXTERNAL statement.


In contrast, system supplied functions in PL/I are referenced through
generic names which can't be used as actual arguments in subroutine
and function calls. The system would have no way to know the type of
the arguments that the function would be called with. In
implementations that I know of, the name actually used to call a
system supplied function is different than the name referenced by the
user, such that there is no conflict between user supplied subroutines
or functions of the same name. (User supplied functions should be
appropriately declared without the BUILTIN attribute.)


In addition, note that both Fortran and PL/I do not consider language
keywords to be reserved words.


-- glen


Post a followup to this message

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