diff --git a/src/hatis/utils.lisp b/src/hatis/utils.lisp new file mode 100644 index 0000000..1e92078 --- /dev/null +++ b/src/hatis/utils.lisp @@ -0,0 +1,15 @@ +(defpackage :xyz.hatis.utils + (:use :cl) + (:export :_->- :wrap :force-output! :format!)) + +(in-package :xyz.hatis.utils) + +(defun _->- (s) (substitute #\- #\_ s)) + +(defun wrap (wrapper proc &rest args) + (apply wrapper args) (apply proc args) (apply wrapper args)) + +(defun force-output! (&rest args) (finish-output nil)) + +(defun format! (&rest args) + (apply #'wrap #'force-output! #'format args))