Boost logo

Boost :

From: Joel de Guzman (joel_at_[hidden])
Date: 2003-10-17 10:46:08

John Torjo <john.lists_at_[hidden]> wrote:
> In the docs for lambda, at a point, Joel de Guzmann suggested a better
> syntax for control structures, namely:
> if_(condition)[then_part]
> if_(condition)[then_part].else_[else_part]
> while_(condition)[body]
> do_[body].while_(condition)
> for_(init, condition, increment)[body]
> I strongly prefer this, but the same could be done for switch_statement,
> which is pretty huge otherwise:
> switch_(condition)
> .case_<label1>[lambda_expression]
> .case_<label2>[lambda_expression]
> What do you think?

Not possible. case_<label1>[lambda_expression] is a
syntax error.

Phoenix-2 will have:

This was already discussed at great lengths but somehow, the implementation
fell through the cracks. Spirit is already using this syntax since Hartmut Kaiser
implemented the switch_p deterministic parsers.


Joel de Guzman

Boost list run by bdawes at, gregod at, cpdaniel at, john at