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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,2078ce7aac45af5b X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.224.180.141 with SMTP id bu13mr10859685qab.2.1352932029864; Wed, 14 Nov 2012 14:27:09 -0800 (PST) Received: by 10.182.119.74 with SMTP id ks10mr2025240obb.5.1352932029831; Wed, 14 Nov 2012 14:27:09 -0800 (PST) Path: gf5ni57984567qab.0!nntp.google.com!u2no3073725qal.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 14 Nov 2012 14:27:09 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=92.235.245.78; posting-account=g4n69woAAACHKbpceNrvOhHWViIbdQ9G NNTP-Posting-Host: 92.235.245.78 References: <0114d327-9f9f-4ad2-9281-56331d11a90c@googlegroups.com> <2bb9e5fa-04a2-4073-bca1-1739ce0580f1@googlegroups.com> <57bca956-2348-4825-8f5f-04fb91863696@googlegroups.com> <094f94ed-dbcc-4dba-bd9d-894a75f69037@googlegroups.com> <8373eaf3-5299-4bbb-a462-56d2d76d6333@googlegroups.com> <1na6brajyyab1.1m57ova8gzvwk$.dlg@40tude.net> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <13b1b5cd-dbea-4376-8f03-53f6a8b68e12@googlegroups.com> Subject: Re: Ada202X : Adding functors From: Martin Injection-Date: Wed, 14 Nov 2012 22:27:09 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-11-14T14:27:09-08:00 List-Id: On Wednesday, November 14, 2012 9:45:26 PM UTC, Simon Wright wrote: > There may be some point in this in C++, if the templating mechanism only > cares about the syntactic feature of ()-represents-invocation. I'm not > sure I want to know. This bit isn't quite right...the point about C++ templates (with their Duck= typing) is that they _don't_ want to know that it's a function call...in f= act, it might be a function call or a functor. And using functors give the = C++ compiler chances to optimise that aren't available otherwise. NB: Functors can also hold state unlike the functions that can't (other tha= n static state - and then you have other problems). Ada already has this 'don't know from looking' feature wrt to arrays (which= look like function calls) and enumerates (pretending to be functions). -- Martin