What often puzzles non-native speakers are the sentences when either if or when is possible (= you can use either).

Are there any general rules that explain when either is fine?

Sorry for the weird examples. Emotion: wink


a. When / If I'm ill, I lie in bed.

Is there any, however subtle, difference in meaning between if and when in this sentence?
I think that both when and if can be replaced with "every time" here:

Every time I'm ill, I lie in bed.

Another example that I think falls into this "category":

b. Many people don't care when / if they see a woman breastfeeding her baby in a public place such as a park.

2) What if we are describing character traits and habits:

a. When / if you like to cause harm, you are evil.
b. When / if you drink alcohol to excess habitually, you are an alcoholic.

In a., when sounds odd to me. In b., both look OK to me.

3) What about:

Many people don't care when / if a woman breastfeeds her baby in a public place such as a park.

Thanks in advance, as always.

EDIT: Made the examples more accesible.
Hi, Pastsimple,

I guess that using either if or whendepends simply on your own choice. When (or if?? Emotion: big smile) both are possible, just choose the one you think is more appropriate for what you want to express, i.e. the one you like more.
It can't be that difficult, can it? Emotion: wink
 Ruslana's reply was promoted to an answer.