INTERMEDIATE: implementation of gen:set.