2.2.4.4 Extract Lambda (πœ†) Expression

Anju provides support for extracting a lambda (πœ†) expression into a function declaration with the menu item β€œExtract πœ†β€¦β€. This feature requires that the point be on the lambda symbol. The screenshots below shows this command in operation.

images/anju-context-menu-extract-lambda-1

The user will be prompted in the mini-buffer for a name of the new function. The example below shows add-two.

images/anju-context-menu-extract-lambda-2

The result is that a temporary buffer named *add-two* (the input name is used) holding the new function is created and a reference to the new function (#'add-two) is substituted in-place at the original location of the lambda expression.

images/anju-context-menu-extract-lambda-3

The *add-two* buffer can be edited as needed and its contents placed into a desired Elisp file.