It doesn't seem like your question has anything to do with homoiconicity---your example is about first-class & higher-order functions.
An equivalent definition in Julia would be cons(x, y) = m -> m == 0 ? x : m == 1 ? y : throw(BoundsError()) car(z) = z(0) cdr(z) = z(1) --SGJ
