I am trying following code:
(require-extension srfi-13)
(require-extension regex)
(print (string-substitute* "This is a test" '(("a test" . "NO TESTING ZONE" ) ) ) )
It works, with following output:
This is NO TESTING ZONE
But following does not work:
(print (string-substitute* "This is a test" '(("a test" . (string-append "NO " "TESTING") ) ) ) )
Following is the error:
Error: (string-substitute) bad argument type - not a string: (string-append "NO " "TESTING")
Even though, following shows that the output is indeed a string:
(print (string? (string-append "NO " "TESTING")))
#t
Where is the problem and how can this be solved?