Conceptual question about multireplace


I have a question about the way that multireplace works, or more specifically, doesn’t work.

It seems that multireplace only works with Boolean or numeric variables. I’m wondering why, since from the computer’s perspective I don’t see why it matters as long as you have an | option for each possible string value excluding user inputs. From the computer’s perspective, I don’t see why there is a difference between 1, 2, and 3, and “1”, “2”, and “3”. Or 1, 2, 3, and “male”, “female”, and “non-binary”, for a use-case example. In both cases, you’re just taking a variable and putting a different input for each possible value of that variable.

Multireplace works similarly as C++ switch/case statement in that the code identify a condition via numerical value.

Number and logical true/false has an inherent value in them where you can arrange them in an orderly fashion, unlike string.

On the other hand, you can always assign number to your gender variable

@{gender man|woman|non-binary}

Yeah, that’s essentially what I ended up doing, I just wasn’t sure about the reason. Thanks.

Question resolved!