3 ms·
It is not clear but it appears you have discovered that it is possible to create circular lists, that is, a list that contains itself. This isn't a flaw, it is
by daly 9y ago
It is not clear but it appears you have discovered that it is possible to create circular lists, that is, a list that contains itself.
This isn't a flaw, it is a feature. Using circular lists it is possible to create "infinite lists". These are useful in many ways.
(setq a (quote #1=(5 . #1#)))
(fifth a)
(seventh a)
This will give you an "infinite stream" of 5
Similarly graph structures can be made so each node in the graph contains the whole graph.
Read Structure and Interpretation of Computer Programs from MIT Press.
- breck 9y agoThanks for the feedback Daly. I have read SICP. What I've discovered is that syntax matters. That if you fix Lisp's syntax, it becomes much easier to program.