Next: , Up: Utils   [Contents]

27.1 String Template

GNU Artanis provides Python3-like template strings:

(make-string-template tpl . vals)

For example:

(define st (make-string-template "hello ${name}"))
(st #:name "nala")
;; ==> "hello nala"

;; or you may specify a default value for ${name}
(define st (make-string-template "hello ${name}" #:name "unknown"))
(st)
;; ==> "hello unknown"
(st #:name "john")
;; ==> "hello john"