I\'m trying to create a function on the fly that would return one constant value.
In JavaScript and other modern imperative languages I would use closures:
Found another solution with lexical-let
(defun foo (n) (lexical-let ((n n)) #'(lambda() n))) (funcall (foo 10)) ;; => 10