2 ms·
I am not sure that's fair, either generally or specifically. The `reduce` function is well known, it's covered in pretty much every mainstream language's standa
by natrys 4y ago
I am not sure that's fair, either generally or specifically. The `reduce` function is well known, it's covered in pretty much every mainstream language's standard library - not just lisps or fringe "functional" languages. I mean Python is imperative, and it always had reduce.
On the other hand, Python's reduce is in global namespace so you pretty much need to know its name. While Emacs doesn't have actual modules or namespaces, if the end goal is organisation and discoverability, I think that's still accomplished by the convention of prefixing function names with a unique and descriptive string. So, seq.el implements many list/sequence related functions. If you type "seq-" and hit tab, the autocompletion menu would show all list related functions, you can just browse for reduce there.
As for how to know about seq.el (or dash.el) in first place, imo these are not that obscure to be hidden from google search. But you can also take any list function that you know about from elsewhere (let's say `count`, or `reduce` itself), then you just need to use the internal search system like `M-x apropos count`, and from `seq-count` result you can deduce that `seq-` is the interesting namespace.
In any case I would contest that Elisp is particularly weird. It also implements lot of Common Lisp anyway under the `cl-` namespace (incidentally there is also `cl-reduce`). As for the matter of it not catching on anywhere, it's still the most popular Lisp used in the world today, a fact that imo makes up for lack of generic tutorials with a lot of Elisp specific tutorials out in the wild.
- roenxi 4y ago> On the other hand, Python's reduce is in global namespace so you pretty much need to know its name. This information is not current, they moved it out of the global namespace in Python 3. > As for how to know about seq.el (or dash.el) in first place, imo these are not that obscure to be hidden from google search. I've been using Emacs for ... I dunno, at least a decade. I've never read seq.el, and if I've heard of it before I brushed it off as irrelevant. Hopefully I didn't need to know about it. There are far to many functions in Emacs for it to be reasonable to expect someone to know any particular family. At least without some efforts at teaching it to them. Now I assume from context that someone who spends a lot of time programming in ELisp is going to run in to this family, but it is unclear why anyone would walk in and think "of I need a seq library!" unless they already happened to be immersed in the functional programming world. Which is to say, unless someone already knows what reduce means, they are not going to look it up in seq.el. > It also implements lot of Common Lisp anyway under the `cl-` namespace (incidentally there is also `cl-reduce`) It includes cl- because Elisp is funky and there are a large contingent of programmers - myself included - who don't want to have to learn a funky lisp to get good results out of our text editor. I'm happy to spend weekends reading up on Common Lisp; that language is awesome.