This is not possible via DWT. The 'name' value of TemplateBeginRepeat cannot be evaluated. You can write another TBB that loops through the package finding your comp1, comp2 and etc and rendering each component. You can also use @@RenderComponentPresentation(compID, templateID)@@ inside your top-level CT and avoid relying on GetLinkedComponents. Finally you can use the Dreamweaver Get Extension (https://sdltridionworld.com/community/extension_overview/dreamweaver_get_extension.aspx) to render nested components or wrote your own Dreamweaver Function Source.