In "Principles of corporate finance" (Brealey, Myers, Allen) the YTM corresponding to a currently priced bond is the "y" unknown from the formula:
(present value of a 8.5% coupon bond - sold at a premium to face value of 100)
This takes into account the actual "equivalent" discount rate that justifies the present value (PV) of the security.
Looking in Investopedia for yield to maturity article I see the following addition though "YTM assumes that all coupon payments are reinvested at a yield equal to the YTM and that the bond is held to maturity"
I wonder what is the proper definition though. In the cash flow model if you want to take into account reinvesting coupons it becomes interesting as you need to solve for "y" considering that at every cash flow point you reinvest with the same yield. (curios also with the math that involves investing coupons).