Boost logo

Boost :

From: Powell, Gary (powellg_at_[hidden])
Date: 2003-10-08 16:20:10


Dave Abrahams wrote:
-----------------------------------------------------------------
a. Is there a *reason* that square brackets have to be used for
   postfix function args in lambdas?

b. It seems like

   lambda(X)[ let[ Y == X %plus% 3,
                   F == minus[2]
              ],
              F[Y]
            ]

   would be a little sweeter, syntactically speaking.
-----------------------------------------------------------------

isn't there a parsing issue here? Where the "," impiles two arguments to the Lambda(X)[] function call, when you really want one fc++Lambda object from binding the "," first. which makes you write:

   lambda(X)[ (
              let[ Y == X %plus% 3,
                   F == minus[2]
              ],
              F[Y]
              )
            ]

which for me is worse. As the let has to generate an object that is unique enough to be recongnized to bind to the F[Y] and generate useful compiler errors otherwise.

Note: my opinion is really biased as Jaakko and I came up with a different syntax.

   -Gary-


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk