(bind-func replace_all
(lambda (orig:i8* rep:i8* with:i8*)
(let ((s1:String* (Str orig))
(s2:String* (Str with))
(cnt 0))
(while (and (not (equal s1 s2))
(< cnt 100))
(set! s2 s1)
(set! s1 (replace s1 rep with))
(set! cnt (+ cnt 1)))
s1)))