START WITH:
(let ((my-list '((12 1 2016)
(12 2 2016)
(12 3 2016)
(12 1 2016)
(12 4 2016)
(12 5 2016)
(12 1 2016))))
INSERT MAGIC HERE
my-list)
DESIRED RESULT:
'(((12 1 2016)
(12 1 2016)
(12 1 2016))
(12 2 2016)
(12 3 2016)
(12 4 2016)
(12 5 2016))
START WITH (a more complicated example):
(let ((my-list '(((12 1 2016) ("foo string" . foo-symbol))
((12 6 2016) ("bar string" . bar-symbol))
((12 3 2016) ("baz string" . baz-symbol))
((12 6 2016) ("doe string" . doe-symbol))
((12 4 2016) ("roe string" . roe-symbol))
((12 5 2016) ("moe string" . moe-symbol))
((12 6 2016) ("joe string" . joe-symbol)))))
INSERT MAGIC HERE
my-list)
DESIRED RESULT:
'(((12 1 2016) ("foo string" . foo-symbol))
((12 3 2016) ("baz string" . baz-symbol))
((12 4 2016) ("roe string" . roe-symbol))
((12 5 2016) ("moe string" . moe-symbol))
(((12 6 2016) ("bar string" . bar-symbol))
((12 6 2016) ("doe string" . doe-symbol))
((12 6 2016) ("joe string" . joe-symbol))))
(1 3 2017)
. Any elements of the initial list that contain the same date should be grouped together please. I assumed (perhaps erroneously) that one answer should work for both cases, but perhaps they require different approaches. – lawlist Jan 4 '17 at 0:42