Wilfred / suggest.el

discover elisp functions that do what you want
367 stars 14 forks source link

Prefer function calls to apply #28

Closed Wilfred closed 7 years ago

Wilfred commented 7 years ago
;; Inputs (one per line):
2
3

;; Desired output:
8

;; Suggestions:
(expt 2 3) ;=> 8
(apply #'expt (list 2 3)) ;=> 8
(apply #'* (-repeat 3 2)) ;=> 8
(apply #'* (make-list 3 2)) ;=> 8
(-product (-repeat 3 2)) ;=> 8

Currently we suggest (apply f (list arg1 arg2)) too frequently when we already have (f arg1 arg2).

Wilfred commented 7 years ago

We should possibly penalise calls to list too.

Wilfred commented 7 years ago

Done in 0172753.