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