Line the bottom of a greased 13- by 9-inch baking pan with wax paper and grease the paper. In a heavy saucepan melt the butter with the cocoa, stirring until the mixture is smooth. Remove the pan from the heat, beat in the brown sugar and the egg, and stir in the flour, the salt, and the vanilla. Spread the mixture in the baking pan, bake it in the middle of a preheated 350°F. oven for 10 minutes, or until it is just firm to the touch and pulls away slightly from the sides, and let it cool in the pan on a rack.
In a heavy saucepan melt the butter, add the brown sugar and the corn syrup, and bring the mixture to a boil over moderate heat, stirring with a wooden spoon. Boil the mixture, stirring occasionally, until it reaches the hard-ball stage (260°F. on a candy thermometer), remove the pan from the heat, and add the cream and the walnuts carefully, stirring gently. Bring the mixture to a boil and boil it until it reaches the soft-ball stage (240°F. on a candy thermometer). Remove the pan from the heat, let the caramel mixture cool for 1 minute, and stir in the rum.
Pour the topping over the base, spreading it evenly with the wooden spoon, let it cool, and chill the confection, covered with foil, for 2 hours, or until it is firm. Run a thin knife around the edges of the pan, turn the confection out onto a cutting board, and cut it into bars. The bars keep, separated by sheets of wax paper, in an airtight container, chilled, for 1 week.