Extending Jim's approach of using add for XOR, and using some matrix functions to remove the loops...and an ASCII table.
These are untested, make sure they do what you expect.
char_xor = Function( {a, b}, {aa, bb},
aa = Blob To Matrix( Char To Blob( a ), "int", 1, "little" ); // string to matrix...
bb = Blob To Matrix( Char To Blob( b ), "int", 1, "little" ); // "0" -> 48, "1" -> 49
cc = Mod( aa + bb, 2 ); // XOR, 48+48->0, 48+49->1, 49+49->0
Blob To Char( Matrix To Blob( cc + 48, "int", 1, "little" ) ); // 0->48, 1->49
);
char_or = Function( {a, b}, {aa, bb},
aa = Blob To Matrix( Char To Blob( a ), "int", 1, "little" ); // string to matrix...
bb = Blob To Matrix( Char To Blob( b ), "int", 1, "little" ); // "0" -> 48, "1" -> 49
cc = aa + bb != 96; // OR, 96 is "0"+"0" == 48+48
Blob To Char( Matrix To Blob( cc + 48, "int", 1, "little" ) ); // 0->48, 1->49
);
char_and = Function( {a, b}, {aa, bb},
aa = Blob To Matrix( Char To Blob( a ), "int", 1, "little" ); // string to matrix...
bb = Blob To Matrix( Char To Blob( b ), "int", 1, "little" ); // "0" -> 48, "1" -> 49
cc = Mod( aa, 2 ) Mod( bb, 2 ); // AND, is element-wise. multiply 0*0, 1*0, 0*1, 1*1
Blob To Char( Matrix To Blob( cc + 48, "int", 1, "little" ) ); // 0->48, 1->49
);
char_not = Function( {a},
Substitute( a, "0", "*", "1", "0", "*", "1" ); // NOT
);
// tests
Show( char_xor( "0011", "0101" ) == "0110",
char_or( "0011", "0101" ) == "0111",
char_and( "0011", "0101" ) == "0001",
char_not( "01" ) == "10" );
p = "00110000011111";
q = "01010101011100";
Show( p, q, char_not( char_and( p, q ) ) == char_or( char_not( p ), char_not( q ) ) ); // De Morgan's Theorem
You might want error checks for bad characters like "010130101".
Wow. Substitute did not work the way I thought it would.
Craige