(defpackage time-adder (:use cl)) (in-package time-adder) (defun alist2seconds (alist) (multiple-value-bind (second minute hour date month year day summerp timezone) (get-decoded-time) (declare (ignore day summerp)) (apply 'encode-universal-time (mapcar (lambda (name default) (or (cdr (assoc name alist)) default)) '(second minute hour date month year timezone) (list second minute hour date month year timezone))))) (defun seconds2alist (seconds) (multiple-value-bind (second minute hour date month year day summerp timezone) (decode-universal-time seconds) (declare (ignore day summerp)) (mapcar 'cons '(second minute hour date month year timezone) (list second minute hour date month year timezone)))) (defun a-b+c (&optional (a nil) (b nil) (c nil) &aux (a (when (listen) (read nil nil))) (b (when (listen) (read nil nil))) (c (when (listen) (read nil nil)))) (seconds2alist (+ (- (alist2seconds a) (alist2seconds b)) (alist2seconds c)))) (defun help-text () (print "Try running ./a-b+c.exe with no standard inputs. Its defaults for a, b and c are the current time. Then maybe try ./a-b+c.exe <