Block or graft polymers prepared by polycondensation of aldehydes or ketones on to macromolecular compounds