kanaka / mal

mal - Make a Lisp
Other
10.04k stars 2.54k forks source link

Questions on different design from lisp: Mal symbol do not use property lists? #637

Closed TehLeo closed 1 month ago

TehLeo commented 1 year ago

In lisp each symbol has a property list. It looks like in mal a completely different design is chosen. What is the reason behind this change and what what are the advantages/disadvantages it brings?

I think this should be mentioned, so that users that are looking to learn how lisp works will not get an incorrect understanding. (Personally, I too checked this repository to learn a bit about lisp and then later found out that lisp handles symbols differently)

Lisp Property lisp: https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node108.html

Lisp Symbol data structure: https://www.gnu.org/software/emacs/manual/html_node/elisp/Symbol-Components.html

wasamasa commented 1 month ago

It's important to remember that MAL follows Clojure semantics, which is a Lisp-1 (same as Scheme and Picolisp). You're speaking of Common Lisp and Emacs Lisp, which are both Lisp-2. In a Lisp-2, it's common to implement independent function/value namespaces by stuffing several slots into a symbol (for example by using a property list). However, this isn't necessarily linked to being a Lisp-2. For example Picolisp does use property lists as well and some Scheme dialects allow accessing the property list, too. Overall, Lisp dialects seem to choose for or against this design based on whether they place importance on symbol manipulation or not (which Picolisp definitely favors). Given that MAL mostly serves learning purposes, symbol manipulation is not considered important at all.