nixpkgs/pkgs/development/lisp-modules/import/util.lisp
Kasper Gałkowski 9e860e41eb lisp-modules: init
From https://github.com/Uthar/nix-cl
Commit ebeb76057abf01029067f1ebe0ae6fae90848bfe
2023-03-02 19:04:47 +01:00

16 lines
374 B
Common Lisp

(defpackage org.lispbuilds.nix/util
(:use :cl)
(:import-from :ppcre)
(:export
:replace-regexes))
(in-package org.lispbuilds.nix/util)
(defun replace-regexes (from to str)
(assert (= (length from) (length to)))
(if (null from)
str
(replace-regexes
(rest from)
(rest to)
(ppcre:regex-replace-all (first from) str (first to)))))