Skip to content

Commit

Permalink
+ hatis.utils
Browse files Browse the repository at this point in the history
  • Loading branch information
shegeley committed Dec 27, 2024
1 parent 010ca82 commit d445244
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/hatis/utils.lisp
Original file line number Diff line number Diff line change
@@ -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))

0 comments on commit d445244

Please sign in to comment.