On Fri, Oct 25, 2019 at 08:35:59AM +0200, pelzflorian (Florian Pelz) wrote:
> On Tue, Oct 22, 2019 at 08:59:40PM +0200, pelzflorian (Florian Pelz) wrote:
> > Thank you for your review.  I will resend tomorrow with these changes.
> > 
> 
> Sorry it takes me longer than expected to implement all of sirgazil’s
> suggestions.  I will finish today.  Ludo, shall I push this evening
> with videos coming from the Internet Archive (archive.org)?
> 

P.S. I would like to request a review of this functions I would like
to add to website/apps/aux/lists.scm:

(define (take-random list n)
  "Return a list containing N elements from LIST, if possible, chosen
randomly and evenly distributed.  If LIST has less than N elements,
the result is a permutation of LIST."
  (let loop ((list list)
             (n n)
             (len (length list)))
    (if (<= (min n len) 0)
        '()
        (let ((r (random-integer len)))
          (cons (list-ref list r)
                (loop (append (take list r)
                              (drop list (1+ r)))
                      (- len 1)
                      (- n 1)))))))


It is meant for selecting 6 screenshots at random when building the
site, as suggested by sirgazil.  Performance is not important, I
suppose.

Also I want to ask, the “license” header says:

;;; GNU Guix web site
;;; Initially written by sirgazil who waves all
;;; copyright interest on this file.

sirgazil, shall I replace “waves” by “waives”?  I believe this is a
typo.

Regards,
Florian

Reply via email to