Nice! Also scsh for guile can be used to get grep and sed functionality. The interesting thing is to try to design sed/grep like functionality that knows about scheme or C or whatever format in some clever way. Usually sad and grep is good enough, but it is an interesting task never the less. My plan for know is to be able to stream scheme source file and be able to sed them with an interface that is close to syntax-parse. That would be really cool.
Cheers On Tue, Aug 27, 2013 at 3:27 PM, Ludovic Courtès <l...@gnu.org> wrote: > > 3) (sed m expr) > > > > This will print out on std output all lines not matched by m, if m is > > matched then that expr will make sure to print the correct way > > > > An example matcher is > > m := (s-tr a b) > > > > which will replace a by b > > FWIW Guix has a sed-like macro, called ‘substitute*’ [0]. Example: > > (substitute* "my-file.txt" > (("^(.*) world$" _ first-word) > (string-append "Hello (was: " first-word ") world\n"))) > > Ludo’. > > [0] > http://git.savannah.gnu.org/cgit/guix.git/tree/guix/build/utils.scm#n387 > > >