From 3085364719267755532
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,9d57bb38940f08c2
X-Google-Attributes: gidf78e5,public
From: thp@vdo.ucr.edu (Tom Payne)
Subject: Re: References to functions allowed?
Date: 1999/01/20
Message-ID: <7833ah$9qg$1@pravda.ucr.edu>#1/1
X-Deja-AN: 434724437
Approved: Fergus Henderson <fjh@cs.mu.oz.au>
References: <36A222B3.E51DFD28@ibm.net>  <OxDGwfArQyo2EwCV@robinton.demon.co.uk> <782f7p$7eq$1@engnews2.Eng.Sun.COM>
X-Original-Date: 19 Jan 1999 23:09:05 GMT
X-Complaints-To: news@news.unimelb.edu.au
X-Trace: izvestia.its.unimelb.edu.au 916816802 25207 128.250.29.16 (20 Jan 1999 07:20:02 GMT)
Organization: University of California, Riverside
X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUANqWDkOEDnX0m9pzZAQHqwgGAlYIyARMMEVVOe+m3L6N91spfFeX6fsnw B+hVjnEWK/cW84JxXsXI6NjZLmiDMVg3 =tuyd
NNTP-Posting-Date: 20 Jan 1999 07:20:02 GMT
Newsgroups: comp.std.c++

Steve Clamage (stephen.clamage@sun.com) wrote:

[...]

: I think the real reason why references to functions are allowed is
: that there is no good reason to prohibit them. That is, allowing them
: 1. does not create any problems (that I know of);
: 2. adds no special cases to the language (functions have special
:    rules whether references are allowed or not);
: 3. removes one special case (we don't prohibit references to functions);
: 4. has at least some minor utility (as with references in general).

It would seem that each of these reasons would apply equally well to
adding references to arrays.

C/C++ sort of gives reference semantics to arrays and functions
already, in the sense that their names designate, not the entities
themselves, but their address.  To compensate, the fundamental
operations on these kinds of entities (respectively, subscripting and
application-to-paramenters) have been changed to work on the addresses
of these entities rather than the entities themselves.

Tom Payne
---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]



