| ▲ | evdubs 6 hours ago | |||||||||||||||||||
Threading macros are nice, though, right? | ||||||||||||||||||||
| ▲ | whartung 3 hours ago | parent | next [-] | |||||||||||||||||||
They're nice, but they're not the same thing. The threading macros are (as I understand it) pure sugar. Turning (-> (gather my-list) uppercase-list sort) into (sort (uppercase-list (gather my-list))). In contrast to, say, Java (I can't speak to the code above):
These are streamed. This is pretty much a pipe structure, whereas the threading macros will create a lot of temporary copies of the data (I don't know if that's a universal truth). That is, if you're processing a 1000 items, say `gather` returns a 1000 items, that 1000 item list is passed to `uppercase-list` which return a new 1000 item list to feed to `sort` which returns another 1000 item list (assuming none of these are destructive).I wish CL had something like the Java streams (maybe it does). | ||||||||||||||||||||
| ||||||||||||||||||||
| ▲ | matheusmoreira 2 hours ago | parent | prev [-] | |||||||||||||||||||
Love those. | ||||||||||||||||||||