I'm hoping some of you more seasoned #emacs veterans can help me with something. I have an #elisp script that creates a plist, but a lot of the values are calculated based on other property values so I've ended up with a ton of (setq my-plist (plist-put my-plist :key (+ (plist-get my-plist :key2) calc-val))) expressions all over the place which seems a bit... unwieldy. Is there a better structure to use for this kind of scenario or is there a better way to go about this? Also I don't know how to do code snippets here, my apologies.
@mykhaylo I'm glad you suggested this because I commonly abstract logic away only to stumble upon a function some time later that does what I want. Especially with Org mode.
In every other language I've used, the built-in APIs for updating a data structure are much more concise. Since it's such a common thing to do, I figured I had to be missing something. I think fset is what I'm missing.
@AblatedSprocket there are very cool libraries to work with hash-maps, that make it almsot as convenient as clojure. Also for general programming. So, for hash maps try:
Add comment