Following the lead of this answer and the interface of mathtools.sty's \DeclarePairedDelimiter macro, I've made a \setof<*|[<size>]|>#1#2 that uses setbuilder notation for a set. But I cannot for the life of me understand why the third setbuilder lines up with the first one rather than the second one.
\documentclass[12pt]{article}
\usepackage{amsmath}
\makeatletter
\def\mathcrel#1{\mathrel{}#1\mathrel{}}
\def\midrel#1{\mathcrel{\middle#1}}
\let\setbuilder|
\def\setof{%
\@ifstar
\setof@S
{\@ifnextchar[%]
\setof@B
\setof@N}}
\def\setof@S#1#2{\left\lbrace #1 \midrel\setbuilder #2 \right\rbrace}
\def\setof@B[#1]#2#3{\mathopen #1\lbrace #2 \mathcrel{#1\setbuilder} #3 \mathclose #1\rbrace}
\def\setof@N#1#2{\lbrace #1 \mathcrel\setbuilder #2\rbrace}
\makeatother
\def\CC{\mathbf C}\def\NN{\mathbf N}
\begin{document}
\begin{align*}
\ell^\infty &= \setof{(x_n) \in \CC^\NN}{\sup_{n\in\NN} |x_n| < \infty}. \\
\ell^\infty &= \setof[\bigg]{(x_n) \in \CC^\NN}{\sup_{n\in\NN} |x_n| < \infty}. \\
\ell^\infty &= \setof*{(x_n) \in \CC^\NN}{\sup_{n\in\NN} |x_n| < \infty}.
\end{align*}
\end{document}
\def\mathcrel#1{\mathrel{#1}}and\def\midrel#1{\nonscript\;\middle#1\nonscript\;}are sufficient. – egreg May 02 '12 at 11:36\mathcrelto\def\mathcrel#1{\mathrel{}\mathclose{}#1\mathopen{}\mathrel{}}. That's necessary because, with your code,#1might not be a relation so you must kill the spacing using mathopen/mathclose. @egreg: what you propose will not always give the same spacing as a mathrel. – Philippe Goutet May 02 '12 at 12:02\mathrelno matter what#1is. – egreg May 02 '12 at 12:14\mathcrelyes, but not\midrel. – Philippe Goutet May 02 '12 at 13:04\def\mathcrel#1{\nonscript\;\mathclose{}#1\mathopen{}\nonscript\;}– Philippe Goutet May 02 '12 at 13:35