dash.el icon indicating copy to clipboard operation
dash.el copied to clipboard

Add `-defun'

Open nbfalcon opened this issue 3 years ago • 12 comments

-defun is like -lambda, but with destructuring. To implement it, abstract the arglist and form generation code of -lambda into separate functions.

Additional benefits of the refactoring are:

  • -lambda (and by extension, -defun) can now accept empty argument lists
  • -lambda (and -defun) no longer rebinds symbols (fixing the TODO)

Various declaration forms should be handled properly in -defun.

Motivation: when this is merged, lsp-defun' can be made an alias for -defun`.

  • Please note the use of intern instead of make-symbol. Using the latter instead caused test-failures.

  • What git-commit-major-mode do you prefer? I assumed and used git-commit-elisp-text-mode here

  • [x] add examples

nbfalcon avatar Nov 06 '20 09:11 nbfalcon