elisp - Looking for convenient way to define lexically scoped aliases for functions -
i'm looking closest equivalent (both typographically , semantically) following if functions in elisp "first-class":
(let ((f function-with-very-long-name)) (progn ... (f ...) ;; evaluates (function-with-very-long-name ...) ... ) ) iow, i'm looking convenient way define lexically scoped aliases functions.
the closest i've found involves binding aliasing symbol (f in example above) lambda in turn calls aliased function. find approach typographically cumbersome. (it negates whatever typographic simplification rest of code may have gained aliasing.)
is there better?
you can use funcall this. example, let below passes 21 a-function-with-an-extremely-long-name, doubles , returns 42:
(defun a-function-with-an-extremely-long-name (i) (* 2 i)) (let ((f 'a-function-with-an-extremely-long-name)) (funcall f 21))
Comments
Post a Comment