(println
  (
    ('((code)  # The symbol 'code is bound to X only once.
      ('((gen) (gen gen))
        '((gen)
          (println code)  # See the output from here.
          ('((partial) (list '(n) (list 'if '(=0 n) 1 (list '* 'n (list partial '(- n 1))))))
           (list (cons 'quote gen) (cons 'quote gen)))
      ))
    ) 'X)
  5)  # (fact 5) is correctly computed then printed.
)
