Hi, Thanks for the patch.
kact...@gnu.org skribis: > +(define (substring-safe str index) > + " > + Return substring of STR, starting at INDEX, > + or empty string, if STR is too short. > + > + +++ (substring-safe \"1234\" 3) > + --- \"4\" > + +++ (substring-safe \"1234\" 6) > + --- \"\" > + " > + (if (< (string-length str) index) > + (string) > + (substring str index))) I share Ian Price’s concerns regarding the fundamental idea behind doctest. Namely, writing code in strings means that syntax errors can only be detected very late, and that the code in there cannot easily refer to anything outside; furthermore, that pollutes docstrings, whose goal is to provide a help string for users. This could be partly addressed by writing sexps instead of strings, though you would still not have compiler warnings & co. So I’m not enthusiastic about encouraging this mechanism by incorporating into Guile. Thoughts? Thanks, Ludo’.