Rev. Jonathan Swift

Richard Ryan, in Poetry and Poets: being a Collection of the choicest Anecdotes relative to the Poets of every Age and Nation (1826) 1:204-05.

Swift, in his lunacy, had some intervals of reason. On one occasion, his physicians took him with them to enjoy the advantages of fresh air. When they came to the Phoenix Park, (Dublin,) Swift remarked a new building, which he had never before seen, and asked, "what it was designed for?" To which Dr. Kingsbury answered, "That, Mr. Dean, is the magazine for arms and powder, for the security of the city." — "Oh, oh!" says the Dean, pulling out his pocket-book, "Let me take an item of that. This is worth remarking; 'my tablets!' as Hamlet says, 'my tablets! Memory, put down that.'" Which produced the following lines, being the last the Dean ever wrote:—

Behold a proof of Irish sense!
Here Irish wit is seen;
When nothing's left that's worth defence,
We build a magazine.

and then put up his pocket-book, laughing heartily at the conceit, and clenching it with, "When the steed's stolen, shut the stable-door."