Let L be a bounded distributive lattice. For k⩾1, let S k ( L) be the lattice of k-ary functions on L with the congruence substitution property (Boolean functions); let S( L) be the lattice of all Boolean functions. The lattices that can arise as S k ( L) or S( L) for some bounded distributive lattice L are characterized in terms of their Priestley spaces of prime ideals. For bounded distributive lattices L and M, it is shown that S 1( L)≅ S 1( M) implies S k ( L)≅ S k ( M). If L and M are finite, then S k ( L)≅ S k ( M) implies L≅ M. Some problems of Grätzer dating to 1964 are thus solved.