(setq *print-circle* T)
;; then create some list with a large number of items, of which a bunch
;; of them repeat
If you then try to print the list in the repl, you will see a lot of unfamiliar text. Each of your items (in the beginning) will show a #1 or #2, etc, depending on the items location in your list. Where the list repeats itself, instead of the item printing out, you will have a #1# #2#, etc, depending on which item it the list it is a repeat of. This threw me, because I wasn't expecting it. I'm not sure if there is a way to mark a list so it won't do this behaviour when you print the object in the repl.
(setq *print-circle* T)
;; then create some list with a large number of items, of which a bunch
;; of them repeat
If you then try to print the list in the repl, you will see a lot of unfamiliar text. Each of your items (in the beginning) will show a #1 or #2, etc, depending on the items location in your list. Where the list repeats itself, instead of the item printing out, you will have a #1# #2#, etc, depending on which item it the list it is a repeat of. This threw me, because I wasn't expecting it. I'm not sure if there is a way to mark a list so it won't do this behaviour when you print the object in the repl.
Nothing has been modified in the list, just the way it was represented was changed.
The way I worked around it is to defun a function to concatenate the list items in a single string, this forced an expansion of the list items.
(defun join-list-items( list )
"joins all items in a list as one big string"
(format nil "~{~a~}" list))
This isn't really a question, more of a warning that "here there be dragons" if you're unfamiliar with how SBCL handles the repl printing of a list that has duplicate items, if print-circle is set.