caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Stroustrup et al. propose to introduce "lambda closures" in C++
@ 2006-03-17 10:07 Eijiro Sumii
  0 siblings, 0 replies; only message in thread
From: Eijiro Sumii @ 2006-03-17 10:07 UTC (permalink / raw)
  To: Caml List; +Cc: Eijiro Sumii

Hi,

A friend of mine informed me of this report

    Lambda expressions and closures for C++
    Jeremiah Willcock, Jaakko Jarvi, Doug Gregor, Bjarne Stroustrup,
Andrew Lumsdaine
    2006-02-26
    http://public.research.att.com/~bs/N1968-lambda-expressions.pdf

and I thought you might be interested.  (I searched a little and
didn't find any discussion on this report in this list.)

A few highlights:

----------------------------------------------------------------------

    We propose to extend the C++ language with lambda expressions, and
define the semantics of these unnamed local functions via translation
to closures: function objects implemented using local classes.

...

    void f() {
      int sum = 0;
      for each(a.begin(), a.end(),
        <>(int x) -> int extern(sum) {return sum += x;});
    }

...

    2.1 Omitting the return type
    The return type of a lambda expression can be omitted if the body
of the lambda function contains at most one return statement.

----------------------------------------------------------------------

Enjoy:-),

        Eijiro


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-03-17 10:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-17 10:07 Stroustrup et al. propose to introduce "lambda closures" in C++ Eijiro Sumii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).