From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7f4d16c4ee371eb5 X-Google-Attributes: gid103376,public From: Hyman Rosen Subject: Re: Why is it Called a Package? Date: 2000/04/07 Message-ID: #1/1 X-Deja-AN: 608062324 Sender: hymie@calumny.jyacc.com References: <38DF7F38.8D656ABD@lmtas.lmco.com> <38DFB0BC.9FF72EFC@callnetuk.com> <87u2hq857e.fsf@deneb.cygnus.argh.org> <38E2A4A4.E59E997C@research.canon.com.au> <8ckfsp$ab8$1@nnrp1.deja.com> X-Complaints-To: abuse@panix.com X-Trace: news.panix.com 955127515 8962 209.49.126.226 (7 Apr 2000 17:11:55 GMT) Organization: PANIX Public Access Internet and UNIX, NYC NNTP-Posting-Date: 7 Apr 2000 17:11:55 GMT Newsgroups: comp.lang.ada Date: 2000-04-07T17:11:55+00:00 List-Id: Brian Rogoff writes: > Yes, uder defined overloadings of [] is a semantic issue, but I wouldn't > think it a good idea if () were used for functions and arrays. I don't > like C++'s "()" overloading, only the "[]" one. But C++'s overloading of () allows referential transparency in template code, which can then be written without regard to whether a functor parameter is an object or a function. That's a very good thing. I could argue that [] in C++ is an extremely low-level concept which should be used only in libraries which need to construct higher-level abstractions, and that therefore allowing it to be overloaded is bad, because it encourages its use. Just like in Ada, high-level C++ data structures such as vectors should use () for indexing.