Comment detail

アレイのuniq (Nested Flatten)

This comment is reply for 485 takatoh: 再帰で(アレイのuniq). Go to thread root.

同じ事をscheme(gauche)で。
わかりやすい流れですねこれ。
pa$はcurry化です。
1
2
3
4
5
6
7
(use srfi-1)

(define (uniq a)
  (if (null? a) a
    (cons (car a) (uniq (remove (pa$ = (car a)) (cdr a))))))

(print (uniq '(3 1 4 1 5 9 2 6 5 3 5 8 9 7 9)))

Index

Feed

Other

Link

Pathtraq

loading...