Fork me on GitHub
#specter
<
2016-08-17
>
codonnell00:08:06

In my opinion, the best solution just uses reduce. Your accumulator would be a map keyed by chat-id with values being a sorted-map storing messages, keyed by timestamp.

richiardiandrea00:08:51

Ok yes that is what I am doing as well :)

richiardiandrea00:08:18

It was just out of curiosity, is it because of the oldest timestamp? In general, just for learning, can I carry a counter while I navigate the data with specter?

codonnell00:08:18

I can't think of a great way to do it using specter. I think specter is better for selecting from or transforming pieces of a nested data structure individually, while your task is aggregating all of your structure into something new. Maybe @nathanmarz has more insight.

richiardiandrea00:08:37

@codonnell: ok thanks a lot

codonnell00:08:11

you're welcome

darwin22:08:47

@nathanmarz: FYI this was needed for fixing my earlier issue (after upgrading to 0.12): https://github.com/binaryage/dirac/commit/45db785491751cd9e23440139f9b2554094c1759

nathanmarz22:08:14

@darwin hmm, ok

nathanmarz22:08:28

@darwin do you have a full stack trace from when the error was happening?