3 ms·
I agree they're both lost metaphors, and also that zip is really not very good. If you grok it, then sure. If you forget it, then its just a random TLA function
by ggm 3y ago
I agree they're both lost metaphors, and also that zip is really not very good. If you grok it, then sure. If you forget it, then its just a random TLA functioncall.
I'm not sure what I think zip() should be. pair() ? smooge()?
Kill ring, and the Yank buffer in Emacs are also misnamed. you don't kill things you put in the kill ring, you are doing the opposite of yank when you put things in with ^Y
- 082349872349872 3y ago⍉, of course. wed()? mate()? ...or for the fanfic'ionados, ship()? (from a comment to TFA: imbricate()?)
- Joker_vD 3y ago> ship()? That'd be Cartesian product. I personally would be fine with line_up() or side_by_side().
- benj111 3y agoInterleave(). Or if that's too long, int(), or leave()
- linguistics__ 3y agoOr if you're working with a list of lists, the wonderful: ↓⍉↑ will do
- frou_dh 3y agoAlso the 'continue' statement in most programming languages does the opposite.
- cryptos 3y agoMaybe "join" like in databases?
- reportgunner 3y agojoin already does something else
- DougBTX 3y agoIt is a join on element index, could be a default if a join field is not set?
- reportgunner 3y agozip makes much more sense to me. It interleaves two sequences same like two halves of a zipper interleave.
- kemotep 3y agoIt’s like zipper merging in a car. And if you don’t know how to zipper merge you really need to.
- jefftk 3y agoBut it doesn't interleave? You get a sequence of pairs.
- reportgunner 3y agoTouche
- quickthrower2 3y agotranspose? In the sense that [[1,2,3,4,5],[6,7,8,9,10]] Becomes [[1,6],[2,7],[3,8],[4,9],[5,10]]
- skrebbel 3y agoWoa! Of course!
- quickthrower2 3y agoAnd if you use PyTorch, its O(1) operation. You just change how you index into the data.
- toth 3y agoI believe numpy introduced ndarrays with user-specified strides, that made this a O(1) operation. Even if not, it certainly predates pytorch in this regard. Pytorch (and other tensor libraries) just used the ndarray concept from numpy.
- quickthrower2 3y agoThanks yeah I didn’t mean to imply that Pytorch invented the idea
- oneeyedpigeon 3y agoWhat about "glue" instead of "zip"? (I guess that's just the same as "paste", but British English, so maybe not the best idea!)