Search
Wednesday, 10th of April 2019, 5:15:09 UTC
5:21:29
beach
p0a: (loop for (i . ii) on list nconc (loop for (j . jj) on ii nconc (loop for k in jj collect (list i j k))))
5:21:51
beach
That way you don't have to uniquify afterwards.
5:25:07
p0a
huh not sure what you did there
5:25:49
p0a
also, is there a way to check if a list of bools is all true without REDUCEing over AND?
5:26:57
p0a
Maybe I can just use loop actually
5:28:18
loke
p0a: You can't reduce over AND (and is a special form)
5:28:26
specbot
http://www.lispworks.com/reference/HyperSpec/Body/f_everyc.htm
5:28:32
loke
What you want is EVERY
5:28:44
loke
(every #'identity LIST)
5:29:08
p0a
I can use NEVER or EVERY, nice, thank you
5:29:16
beach
p0a: All I did was to use the remaining list in the nested loops, rather than the entire list.
5:30:08
p0a
so what about the previous values ?
5:30:34
p0a
ooh that's qhy it's unique, nice
5:35:29
p0a
beach: that's very nice, thanks!
5:35:58
p0a
I now understand that you're using `on' to go through the list one cdr at a time
5:49:25
p0a
alright, have to go. Thank you a lot
6:39:16
pjb
(defun combinations (list n) (cond ((zerop n) '()) ((= 1 n) (mapcar (function list) list)) (t (mapcan (lambda (rest) (mapcan (lambda (first) (list (cons first rest))) list)) (combinations list (1- n)))))) (combinations '(a b c) 3) #| --> ((a a a) (b a a) (c a a) (a b a) (b b a) (c b a) (a c a) (b c a) (c c a) (a a b) (b a b) (c a b) (a b b) (b b b) (c b b) (a c b) (b c b) (c c b) (a a c) (b a c) (c a c) (a b c) (b b c) (c b c) (a
6:52:10
splittist
top o' the mornin'
7:01:02
splittist
loke: http://dialectblog.com/2011/06/27/top-o-the-morning-myth-and-reality/
7:40:15
Josh_2
top 'o the mornin to ya splittist
12:56:53
Lord_of_Life_
** NICK Lord_of_Life
Wednesday, 10th of April 2019, 17:15:09 UTC