But you haven't put it in a function, you have tried to run it outside, straight after the distance declaration. You can't do this. You have to use...

distance = vec_dist(house.z,snowman.z) inside a function.