Based on this question i did some experiments with tikzset, coordinates and foreach. The following code plots four times the same thing. Twice with and twice without a tikzset. Twice with and twice without foreach. The variante where I use foreach and coordinate does not work. Why is that? The syntax looks ok to me...
\documentclass[border=5mm]{standalone}
\usepackage{tikz}
\tikzset{
pics/coordiarrow/.style 2 args={
code={
\coordinate (A) at #1;
\coordinate (B) at #2;
\node [left] at (A) {#1};
\node [left] at (B) {#2};
\draw [->, thick] (A) -- (B);
}}}
\tikzset{
pics/paraarrow/.style 2 args={
code={
\node [left] at #1 {#1};
\node [left] at #2 {#2};
\draw [->, thick] #1 -- #2;
}}}
\begin{document}
\begin{tikzpicture}
\draw[help lines] (-3,-3) grid (3,3);
\pic at (0,0) {coordiarrow={(1,1)}{(3,3)}}; %%% Uses coordinates but no foreach
\pic at (0,0) {coordiarrow={(-1,1)}{(-3,3)}};
\pic at (0,0) {coordiarrow={(1,-1)}{(3,-3)}};
\begin{scope}[shift={(8,0)}]
\draw[help lines] (-3,-3) grid (3,3);
\pic at (0,0) {paraarrow={(1,1)}{(3,3)}}; %%% Uses no coordinates and no foreach
\pic at (0,0) {paraarrow={(-1,1)}{(-3,3)}};
\pic at (0,0) {paraarrow={(1,-1)}{(3,-3)}};
\end{scope}
\begin{scope}[shift={(0,7)}]
\draw[help lines] (-3,-3) grid (3,3);
\foreach \from/\to in %%% Uses no coordinates but uses foreach
{{(1,1)}/{(3,3)},{(-1,1)}/{(-3,3)},{(1,-1)}/{(3,-3)}}
{\pic at (0,0) {paraarrow={\from}{\to}};}
%%%%%% If uncommented, it does not compile anymore %%%%%
% \begin{scope}[shift={(8,0)}]
% \draw[help lines] (-3,-3) grid (3,3);
% \foreach \from/\to in %%% Uses coordinates and foreach
% {{(1,1)}/{(3,3)},{(-1,1)}/{(-3,3)},{(1,-1)}/{(3,-3)}}
% {\pic at (0,0) {coordiarrow={\from}{\to}};}
% \end{scope}
\end{scope}
\end{tikzpicture}
\end{document}

\tois a bad choice since it is also a standard macro. That's not the problem, mind. – cfr Dec 10 '15 at 00:25