  We introduce a random coding technique for transmission over discrete
memoryless channels, reminiscent of the basic construction attaining the
Gilbert-Varshamov bound for codes in Hamming spaces. The code construction is
based on drawing codewords recursively from a fixed type class, in such a way
that a newly generated codeword must be at a certain minimum distance from all
previously chosen codewords, according to some generic distance function. We
derive an achievable error exponent for this construction, and prove its
tightness with respect to the ensemble average. We show that the exponent
recovers the Csisz\'{a}r and K{\"o}rner exponent as a special case, which is
known to be at least as high as both the random-coding and expurgated
exponents, and we establish the optimality of certain choices of the distance
function. In addition, for additive distances and decoding metrics, we present
an equivalent dual expression, along with a generalization to infinite
alphabets via cost-constrained random coding.
