Thank you for the hints. I'll try it later today.
Regarding the bool to int conversion it is my opinion that a boolean is a type with a domain of {false, true} and I do not have an implicit mapping from {false, true} to int. It is as sensible for false to map to -1 as it is to map to 0. The same holds for true. So I do not want to rely on this arbitrary mapping wich seems more like a coincidence than a resonable idea to me.
_Join the equal rights for zero movement_
Why should 0 be false even if it is a completely normal number?
regards,
Brian
Comment
Ah, I found a way to solve this in python. I can define a hash indexed by true and false. e.g.
{true: 0, false: 1}[a[i] == b[j]]
does the same as
a[i] == b[j] ? 0 : 1
Parent comment
Thank you for the hints. I'll try it later today. Regarding the bool to int conversion it is my opinion that a boolean is a type with a domain of {false, true} and I do not have an implicit mapping from {false, true} to int. It is as sensible for false to map to -1 as it is to map to 0. The same holds for true. So I do not want to rely on this arbitrary mapping wich seems more like a coincidence than a resonable idea to me. _Join the equal rights for zero movement_ Why should 0 be false even if it is a completely normal number? regards, Brian
Replies
Nice, that's a trick I haven't used before. I like it. :)