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

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

Bubble Sort Manually a Linked List in Java -

asp.net mvc - SSO between MVCForum and Umbraco7 -