Hacker News new | ask | show | jobs
by nequo 667 days ago
This wiki page raises some good points, for example, the stateful nature of some of the APIs:

  Instead of returning a data structure of the match results (eg from a call to match-string), the match results are mutated in global memory and accessed in separate function calls. This is both less functional in style and more error prone. For example, if save-match-data is not used appropriately, then library functions can trample on the match data which a higher level function is in the middle of using.
But in some other parts it reads like two or more personalities stuck in the same body shouting at each other using the same mouth:

  EmacsLisp Isn't Scheme

  This, from my highly unscientific sample, is far and away the most popular reason EmacsLisp sucks. Well, that’s good to know. EmacsLisp is also not Perl, or COBOL, or IBM 1130 assembler, or a bicycle, or an orange. Thanks for the help!
4 comments

Fairly amusing that just today I was looking at some elisp code I wrote a few years ago. A comment I had inserted:

     ;; Also, I need the ~save-match-data~ because apparently
     ;; ~split-string~ messes up the match information. I spent hours
     ;; debugging this.
That’s the charm of EmacsWiki. It really is community-edited!
It used to function as a semi permanent archive of all the babblings on #emacs on freenode. Those were the days...
Reminds me I often wished (and tried~) to make a purely functional regex lib in elisp
The problem with that statement isn't that some APIs use state but that the reason those APIs need state wasn't documented.