Boost logo

Boost Users :

Subject: Re: [Boost-users] [boost] Boost.Local Review (Nov 10, 2011 to Nov 19, 2011)
From: Paul A. Bristow (pbristow_at_[hidden])
Date: 2011-11-17 04:32:34


From: boost-users-bounces_at_[hidden] [mailto:boost-users-bounces_at_[hidden]] On Behalf Of
Vicente J. Botet Escriba
Sent: Wednesday, November 16, 2011 6:21 PM
To: boost-users_at_[hidden]
Subject: Re: [Boost-users] [boost] Boost.Local Review (Nov 10, 2011 to Nov 19, 2011)

 

Le 16/11/11 16:41, Paul A. Bristow a écrit :

From: <mailto:boost-users-bounces_at_[hidden]> boost-users-bounces_at_[hidden]
<mailto:[mailto:boost-users-bounces_at_[hidden]]> [mailto:boost-users-bounces_at_[hidden]]
On Behalf Of Jeffrey Lee Hellrung, Jr.
Sent: Thursday, November 10, 2011 5:53 AM
To: <mailto:boost-announce_at_[hidden]> boost-announce_at_[hidden];
<mailto:boost-users_at_[hidden]> boost-users_at_[hidden]
Subject: [Boost-users] [boost] Boost.Local Review (Nov 10, 2011 to Nov 19, 2011)

 

The review of Lorenzo Caminiti's proposed Boost.Local library begins tomorrow, ***November 10,
2011***, and ends on ***November 19, 2011***.

Other questions you may want to consider:

- What is your evaluation of the design?

 

I have some concern about manipulation of C++ to do things it wasn't really designed to:

 

if C++ is intended to have local functions, it should be part of the language.

If I'm not wrong lambdas play a role similar to unnamed local functions, and they are already in the
language. The intent of Boost.Local is to provide something similar on compilers that doesn't
support lambdas.

 

'Abuse' like this tends to cause trouble, and more important, it puts off the day when we abandon
this "absurdly ambiguous language" in favour of new language X (or have we run out of letters for
new languages? ;-) un-shackled by any primitive and obsolete features inherited from C.

Well, you know, the first uses of exceptions and templates in C++ were possible thanks to some
preprocessor magic libraries. While incomplete, these 'emulations' allowed to some of us to start
using these features and surely pushed to include them properly on the language later on. The
preprocessor is a really useful tool that has his place in such contexts.

Unfortunately, the local function emulation needs to bind explicitly the used variables. I think,
that even with lambdas in the language, local functions will have his place, as soon as they provide
access to the enclosing function data.

 

But that hasn't stopped many people making good use of such devices, for example, Boost.Parameter.

Yes this is another example of things that could be included in the language and in this case that
can be emulated using a library.

I understand that a language can not include all the features desired by each user, and that there
could be other missing features with a higher added value, but there is one feature that I think is
missing in C++: the scoped exit/success/failure as defined in language D. I hope the emulation of
Boost.ScopedExit or Boost.Local could show its usefulness and that someone will make a concrete
proposal to the standard committee.

OK, I'm just playing the Devil's Advocate here.

 

I'm sure that checking usefulness with fancy macros is one route for language development (but not
the only one). It certainly allows many people to see how useful they find the feature without a
major language change.

 

And I suspect it will be found useful - but I'm not sure how useful.

 

Paul

 

 



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net