Comment

Comment by natrys

My Lisp education was mostly from Elisp, but this I understood early when I was reading some random code and came across:

    (setf (buffer-string) "hello")
I thought this was just bananas, turns out that Elisp setf simply has a bunch of hardcoded rules for matching getters/setters for even a lot of non-standard data structures like Buffer that are Emacs specific. So the above gets rewritten to:

    (insert (prog1 "hello" (erase-buffer)))
It's not exactly AGI but still very cool.
parent natrys 2 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton