>>339 Emacs Lisp

誤 (- (apply (quote max) x) (car x))
正 (- (apply (quote max) (cdr x)) (car x))

% cat example3.txt
10
9
7
4
0

% cat example3.txt | emacs -batch -Q --eval='(progn (require (quote cl-lib)) (let (l) (cl-loop (let ((x (ignore-errors (read)))) (if x (push x l) (cl-return))))
> (print (apply (quote max) (cl-mapcon (lambda (x) (when (cdr x) (list (- (apply (quote max) (cdr x)) (car x))))) (reverse l))))))' | sed 's/Lisp expression://g'
-1