3 ms·
alists and plists are a much closer lisp analog to python's dicts though
by NikkiA 3y ago
alists and plists are a much closer lisp analog to python's dicts though
- deleted 3y ago[deleted]
- trealira 3y agoThat's fair. Dictionary literals aren't really any more concise than a-lists. A-list: (("the" . 50) ("be" . 25)) Dictionary literal: {"the": 50, "be": 25 }
- RodgerTheGreat 3y agoUsing both a-lists and p-lists as mere structural conventions- and thus needing to convert back and forth or write multiple versions of routines to handle each- is a good example of how sexprs provide a superficial veneer of simplicity while inviting cancerous complexity in practice. The Clojure approach of recognizing associative structures as a fundamental building-block and giving them specialized syntax: {:the 50 :be 25} Is a clear-cut improvement.
- NikkiA 3y agoAt the risk of waking Naggum's ghost, plists are performant enough to use everywhere, and an alist can be converted to a plist merely by flattening it. I do covet the way clojure's associations are callable as a lookup method, though.