Name: Anonymous 2012-05-15 18:41
Gentlemen I conclude that C is the best language for functional programming. Observe:
typedef unsigned char u8;
u8 change_bit(u8 in_byte, u8 bit_pos, u8 new_bit) {
return (new_bit ? in_byte | (1u << bit_pos) : in_byte & ~(1u << bit_pos));
}