I am constructing several curves, which are all constructed differently, but they have path name=lambda1, ..., lambda4. Later, I intersect each of them with one path. Attached is a working minimal example.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{intersections}
\begin{document}
\begin{tikzpicture}
\path[name path=t1] (6,0) -- (6,7);
\draw[name path=lambda1] (0,4) -- (7,3.5);
\draw[name path=lambda2](0,2.5) sin (7,4.5);
\draw[name path=lambda3] (3,0) parabola (7,5);
\draw[name path=lambda4] (2,0) .. controls (3,4) .. (7,7);
\fill [red, name intersections={of=lambda1 and t1}] (intersection-1) circle (2pt) node [below] {$\lambda_1$};
\fill [red, name intersections={of=lambda2 and t1}] (intersection-1) circle (2pt) node[below] {$\lambda_2$};
\fill [red, name intersections={of=lambda3 and t1}] (intersection-1) circle (2pt) node[below] {$\lambda_3$};
\fill [red, name intersections={of=lambda4 and t1}] (intersection-1) circle (2pt) node[below] {$\lambda_4$};
\end{tikzpicture}
\end{document}
The last 4 lines beg for a \foreach, but I can't make it work entirely. To me, it seems that
\foreach \n in {1,...,4} {
\fill [red, name intersections={of=lambda\n and t1}]
(intersection-1) circle (2pt) node[below] {$\lambda_\n$};}
should be the right solution, but it is not. However,
\foreach \n in {1,...,4} {
\fill[red, name intersections={of=t1 and lambda\n}]
(intersection-1) circle (2pt) node[below] {$\lambda_\n$};}
works fine. What am I missing here?

lambda\n andexpands tolambda1andand TikZ interprets this as the path name, whereupon it gets confused because the ` and ` is missing. Jake's solutions avoid this space-swallowing by ensuring that\nis not followed by a space. – Andrew Stacey Apr 4 '12 at 21:50