A decomposition of an L-valued finite fuzzy set (L is a lattice) gives a family of characteristic functions, which can be considered as a binary block-code. Using a previous theorem of synthesis for fuzzy sets, we give conditions under which an arbitrary block-code corresponds to an L-valued fuzzy set. An explicit description of the Hamming distance, as well as of any code distance is also given, all in lattice-theoretic terms. Finally, we give necessary and sufficient conditions under which a linear code corresponds to an L-valued fuzzy set. It turns out that in such case the lattice L has to be Boolean.