Here's a solution which basically
- adds a
contents line to the file \jobname.prb
- reads that file with the command
\listmytheorems
I've used the extension .prb simply because I've used in previous work
Custom list of environments (per section)
I've used the etoolbox which provides many commands- the only one relevant to my code is \ifstrempty

\documentclass{article}
\usepackage{amsthm} % for theorems
\usepackage{lipsum} % for sample text
\usepackage{etoolbox} % \ifstrempty (and more)
% enable the \jobname.prb file
% (hacked from the ntheorem package)
\makeatletter%
\def\prb@enablelistofproblems{%
\begingroup%
\if@filesw%
\expandafter\newwrite\csname tf@prb\endcsname%
\immediate\openout \csname tf@prb\endcsname \jobname.prb\relax%
\fi%
\@nobreakfalse%
\endgroup}%
% enable the \jobname.prb files at the end
% of the document
\AtEndDocument{\prb@enablelistofproblems}%
\makeatother%
\newread\File
\def\listmytheorems{%
% open the \jobname.prb and read the contents
\par%
\openin\File=\jobname.prb%
\loop\unless\ifeof\File%
\read\File to\fileline%
\fileline%
\repeat%
\closein\File%
}%
% your theorem- with some tweaks
\newtheoremstyle{mystyle}
{\topsep}
{\topsep}
{}
{}
{\bfseries}
{:}
{\newline}
{\thmname{#1}\thmnumber{ #2}\thmnote{ (#3)}%
\ifstrempty{#3}{\addcontentsline{prb}{section}{#1 \themydef}}{\addcontentsline{prb}{section}{#1 \themydef~(#3)}}
}
\theoremstyle{mystyle}
\newtheorem{mydef}{Definition}
\begin{document}
\subsection*{List of my definitions}
\listmytheorems
\begin{mydef}[description goes here]
\lipsum[1]
\end{mydef}
\begin{mydef}
\lipsum[1]
\end{mydef}
\begin{mydef}
\lipsum[1]
\end{mydef}
\begin{mydef}
\lipsum[1]
\end{mydef}
\begin{mydef}
\lipsum[1]
\end{mydef}
\begin{mydef}
\lipsum[1]
\end{mydef}
\end{document}
\begin{mydef}[description goes here]to only havedescription goes herein the list of definitions ? – projetmbc Apr 12 '12 at 20:41Description X? – Werner Apr 12 '12 at 22:42Definition 1,Definition 2,... ? On the other hand, I think very usefull to have the list of important definitions and theorems in one course. – projetmbc Apr 12 '12 at 23:06{#1 \themydef~(#3)}to{#3}– cmhughes Apr 13 '12 at 16:47\ifstrempty{#3}{\addcontentsline{prb}{section}{#1 \themydef}}{\addcontentsline{prb}{section}{#1 \themydef~(#3)}}to\ifstrempty{#3}{}{\addcontentsline{prb}{section}{#3}}. That's perfect ! – projetmbc Apr 13 '12 at 16:55