Live data from Hacker News

These years in Common Lisp: 2023-2024 in review

lisp-journey.gitlab.io

51–54 of 54 posts

Re: These years in Common Lisp: 2023-2024 in review

#51
post #41

Earlier quoted context omitted.

Writing a reader macro that allows for something like... [some-numbers 0] ...to get the first (many programming languages make this mistake, using 0 to refer to the first element of a collection, so we can forgive CL for this) element. But I'm curious how you can write... (object -> slot) ...without getting an error about OBJECT not being a valid function or macro.

> so we can forgive CL for this The 1962 dated Lisp 1.5 Programmer's Manual already describes a 0 based array feature. Lisp was clearly one of the historic instigators of zero based array, rather than just playing along.

Yes, but the various Lisps that Common Lisp is the more-or-less common subset of are (were?) all 0-indexed. Between easy heap implementation (left is (ash index 1), right is (1+ (ash index 1)), parent is (ash index -1)) and easy last element selection (nth seq (length seq)) I prefer 1-indexing, but I realize that's an unpopular opinion.
Post reply on HN