Good to know. Thanks for replying Chainsaw and Blackadder.
What about in a situation after melee has begun? Here's a for instance: the group is already engaged in combat when they become surrounded by a group of monsters. The warlock (or magician or whatever) wants to cast a spell during his/her turn, while surrounded by enemies. Do you allow the warlock to cast (with the assumption that if he's hit for damage the spell will be ruined anyway), or do you make a rule that when engaged in melee with other monsters it is now impossible?
Ranged is fairly self-explanatory, but I can see an argument either way for melee encounters. I personally allow it because the ruination of a spell is fairly risky. Losing it will tax resources.