Wilfred / suggest.el

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

Add more string functions #45

Closed nickdrozd closed 6 years ago

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.3%) to 95.27% when pulling e844ec4c1988dbba7922b58d4bc619081e157943 on nickdrozd:more-string-functions into a56b1ec98063ed88295311b5c1dde4a701a4596e on Wilfred:master.

Wilfred commented 6 years ago

Thanks.

FWIW the predicate functions aren't very useful at the moment. At some point I hope to add the ability for users to enter multiple examples, in which case the predicates will be really handy.

nickdrozd commented 6 years ago

Yeah, there's definitely a risk of having bunch of garbage slowing things down and cluttering the results. Still, it's great when it has what you need:

;; Inputs (one per line):
(lambda () 5)

;; Desired output:
t

;; Suggestions:

(listp (lambda () 5)) ;=> t                         ;; no
(consp (lambda () 5)) ;=> t                         ;; no
(sequencep (lambda () 5)) ;=> t                     ;; no
(functionp (lambda () 5)) ;=> t                     ;; ding ding ding
(arrayp (prin1-to-string (lambda () 5))) ;=> t      ;; no

My approach up this point has to add any simple function that I feel should have been suggested to me but wasn't. Maybe stricter criteria should be established.