Depending on the solvent, $\mathrm{ROH}$ reacts with $\mathrm{SOCl}_2$ to give $\mathrm{RCl}$ by two pathways, each of which involves formation of a chlorosulfite ester,
<smiles>O=[Se](=O)Cl</smiles>
along with $\mathrm{HCl}$. Use the following stereochemical results to suggest mechanisms for the two pathways: In pyridine, a $3^{\circ}$ amine base,
$$
\text { (R)- } \mathrm{CH}_3 \mathrm{CH}(\mathrm{OH}) \mathrm{CH}_2 \mathrm{CH}_3 \longrightarrow(S)-\mathrm{CH}_3 \mathrm{CHClCH}_2 \mathrm{CH}_3
$$
and, in ether, the same $(R)-\mathrm{ROH} \longrightarrow(R)-\mathrm{RCl}$.
Pyridine (Py) reacts with the initially formed $\mathrm{HCl}$ to give $\mathrm{PyH}^{+} \mathrm{Cl}^{-}$and the free nucleophilic $\mathrm{Cl}^{-}$attacks the chiral $\mathrm{C}$ with inversion, displacing the $\mathrm{OSOCl}^{-}$as $\mathrm{SO}_2$ and $\mathrm{Cl}^{-}$. With no change in priority, inversion gives the $(S)$ $\mathrm{RCl}$. Ether is too weakly basic to cause enough dissociation of $\mathrm{HCl}$. In the absence of $\mathrm{Cl}^{-}$, the $\mathrm{Cl}$ of the $-\mathrm{OSOCl}$ attacks the chiral $\mathrm{C}$ from the side to which the group is attached. This internal nucleophilic substitution $\left(\mathbf{S}_{\mathrm{N}} \mathbf{i}\right)$ reaction proceeds through an ion-pair and leads to retention of configuration.