Chris Angelico <[email protected]>:
> You prove here that Python has first-class expressions in the same way
> that 80x86 assembly language has garbage collection. Sure, you can
> implement it using the primitives you have, but that's not support.
I was more reminded of STL and Boost. For example:
std::for_each(v.begin(), v.end(),
(
switch_statement(
_1,
case_statement<0>(std::cout << constant("zero")),
case_statement<1>(std::cout << constant("one")),
default_statement(cout << constant("other: ") << _1)
),
cout << constant("\n")
)
);
(<URL: http://www.boost.org/doc/libs/1_55_0/doc/html/lambda/
le_in_details.html#lambda.switch_statement>)
Marko
--
https://mail.python.org/mailman/listinfo/python-list