Just yesterday I felt the same confusion. I'm working on a JavaScript web application that communicates with a Common Lisp backend using S-expressions one way and JSON the other way (for good enough reasons).
I devised a neat scheme with nested alists and wrote a poorly-specified, bug-ridden implementation of half of Common Lisp in JavaScript to make sense of it all. Then I got really confused for a couple of weeks until I finally figured out why it was so hard to get right.
JavaScript doesn't have a cons or pair type. There's just no way to get cdr and cons to work sanely without being able to juggle Arrays' individual conses. Adding a class for such a fundamental unit and implementing my own linked lists with that would bog everything down just a bit too much. So the house of cards collapsed.
In hindsight it's obvious, but I spent a lot of time wondering why the whole thing was so confusing.
That's interesting... I've been thinking about this for a while now and at first I thought it would be incredibly bloated, but now I'm not so sure. Definitely interesting.
I devised a neat scheme with nested alists and wrote a poorly-specified, bug-ridden implementation of half of Common Lisp in JavaScript to make sense of it all. Then I got really confused for a couple of weeks until I finally figured out why it was so hard to get right.
JavaScript doesn't have a cons or pair type. There's just no way to get cdr and cons to work sanely without being able to juggle Arrays' individual conses. Adding a class for such a fundamental unit and implementing my own linked lists with that would bog everything down just a bit too much. So the house of cards collapsed.
In hindsight it's obvious, but I spent a lot of time wondering why the whole thing was so confusing.