Re: string-unfold demo

2017-08-28 Thread Alex Vong
Hello Guilers, Since I find this exercise interesting, I come up with another demo. The trick is to think of string as a list of characters (like in Haskell) and to use the fact that append can be written as an unfold. Let's begin: 1. Use SRFI-1 and SRFI-26 (use-modules (srfi srfi-1)

string-unfold demo

2017-08-26 Thread Matt Wette
Just for kicks, to learn string-unfold, I made an ugly version of string-append: (define (ugly-string-append . str-l) ;; p: seed |-> #t|#f predicate to indicate stop (define (p seed) (null? seed)) ;; f: seed |-> charoutput function (define (f seed) (string-ref (cddar seed) (caar se