# How to nest comment and theorem in one environment?

I'm using comment and amsthm packages for comments and theorems. I'd like to skip some theorems. I've tried to create a new environment with theorem nested in a comment:

\documentclass{book}
\usepackage{amsthm,comment}
\excludecomment{myblock}

\newtheorem{thDef}{Definition}
\newenvironment{envDef}%
{\begin{myblock}\begin{thDef}}%
{\end{thDef}\end{myblock}}

\begin{document}
\begin{envDef}My definition.\end{envDef}
\end{document}


But I've got an error:

! File ended while scanning use of \next.


Did I miss something?

UPDATE: When I comment out the theorem environment directly, then LaTeX emits exactly the same error:

\newtheorem{thDef}{Definition}
\excludecomment{thDef}

! File ended while scanning use of \next.


You can't hide an environment marked with \excludecomment inside another environment's definition. The and \end{myblock} tag must appear explicitly in the input, because it's taken as a literal delimiter.
% \excludecomments{envDef} % uncomment for not showing envDef