[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [elpa] master 93e9009: Implement `seq-mapn' method for streams
From: |
Nicolas Petton |
Subject: |
Re: [elpa] master 93e9009: Implement `seq-mapn' method for streams |
Date: |
Tue, 09 Jan 2018 14:38:58 +0100 |
Michael Heerdegen <address@hidden> writes:
> Implement `seq-mapn' method for streams
Nice!
> [...]
> +(ert-deftest stream-seq-mapn-test ()
> + (should (streamp (seq-mapn #'+ (stream (list 1 2 3)) (stream (list 4 5
> 6)))))
> + (should (not (streamp (seq-mapn #'+ (stream (list 1 2 3)) (stream (list 4
> 5 6)) (list 7 8 9)))))
> + (should (= 2 (seq-length (seq-mapn #'+ (stream (list 1 2 3)) (stream (list
> 4 5))))))
> + (should (equal (letrec ((fibs (stream-cons
> + 1
> + (stream-cons
> + 1
> + (seq-mapn #'+ fibs (stream-rest fibs))))))
> + (seq-into (seq-take fibs 10) 'list))
> + '(1 1 2 3 5 8 13 21 34 55))))
Thanks for the unit tests, that's awesome!
Nico
signature.asc
Description: PGP signature
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [elpa] master 93e9009: Implement `seq-mapn' method for streams,
Nicolas Petton <=