Boost logo

Boost :

Subject: Re: [boost] [contract] syntax redesign
From: Lorenzo Caminiti (lorcaminiti_at_[hidden])
Date: 2011-11-06 21:31:04


On Tue, Oct 25, 2011 at 11:35 AM, Lorenzo Caminiti
<lorcaminiti_at_[hidden]> wrote:
> On Mon, Oct 24, 2011 at 7:01 PM, lcaminiti <lorcaminiti_at_[hidden]> wrote:
>> Dave Abrahams wrote:
>>> No, it's still too dense because of the comments (and the redundant
>>> optional "namespace tag").  Try again, please :-)
>> Sure, that's easy. Let me know if this still requires more work:

I re-wrote all examples from Boost.Parameter using the proposed
Boost.Contract syntax for named parameters (these named parameter
examples don't compile yet):

https://svn.boost.org/svn/boost/sandbox/contract/libs/contract/doc/html/contract__/examples.html#contract__.examples.__named_parameters___depth_first_search__required_and_optional_named_parameters

With named parameters for templates and constructors, Boost.Contract
should be able to save the programmer from some boiler-plate code
required instead by Boost.Parameter:

https://svn.boost.org/svn/boost/sandbox/contract/libs/contract/doc/html/contract__/examples.html#contract__.examples.__named_parameters___python__class___named_template_parameters
https://svn.boost.org/svn/boost/sandbox/contract/libs/contract/doc/html/contract__/examples.html#contract__.examples.__named_parameters___my_class__constructors_with_named_parameters

This additional example mixes a bit more named parameters and contracts:

https://svn.boost.org/svn/boost/sandbox/contract/libs/contract/doc/html/contract__/examples.html#contract__.examples.__named_parameters___positive_number__fine_grained_parameter_name_control

Comments are always welcome :)

--Lorenzo


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