After they are defeated by the Israelites at Rephidim, God promises unending judgement on Amalek in Exodus 17:
14Then the Lord said to Moses, “Write this as a memorial in a book and recite it in the ears of Joshua, that I will utterly blot out the memory of Amalek from under heaven.” 15And Moses built an altar and called the name of it, The Lord Is My Banner, 16saying, “A hand upon the throne of the Lord! The Lord will have war with Amalek from generation to generation.” ESV
The reason for the judgement and the form of the judgement are given in slightly more detail in Deuteronomy 25:
17“Remember what Amalek did to you on the way as you came out of Egypt, 18how he attacked you on the way when you were faint and weary, and cut off your tail, those who were lagging behind you, and he did not fear God. 19Therefore when the Lord your God has given you rest from all your enemies around you, in the land that the Lord your God is giving you for an inheritance to possess, you shall blot out the memory of Amalek from under heaven; you shall not forget. ESV
What I find difficult to understand is how ‘the Lord will have war with Amalek from generation to generation’ if their memory has been blotted out from under heaven. Am I missing the Hebrew idiom here? Is one or other of the statements not to be taken literally, and if so, which one?