Friday, 15 March 2013

emacs - Elisp Format specifier doesn't match argument type error -



emacs - Elisp Format specifier doesn't match argument type error -

i getting "format specifier doesn't match argument type" error when trying run main function interactively. code is:

(defun average(grade) (setq split (/ grade 10)) (cond ((= split 10) "a") ((= split 9) "a") ((= split 8) "b") ((= split 7) "c") ((= split 6) "d") ("f"))) (defun main(g) (interactive "ngrade: ") (message "%d" (average g )))

can help inputing/outputing wrong? give thanks you

the error in format line

(format "%d" (average g))

wants format integer you're returning string, should be:

(format "%s" (average g))

as aside, m-x ielm useful when testing elisp.

emacs arguments elisp conditional

No comments:

Post a Comment