Note that is it is not a good idea to name your unit defer and subsequently in main a variable that is also called defer, while also having a defer in the uses clause.
I would change the unit name in this case, suggest fpcdefer, deferrer or something.
It is not knit-picking. Such name clashes can bite.
But it is very neat code, may come in useful.