I use the following function to turn a list of posns into a list of triples (posn, posn, symbol) for later use by draw-solid-line:
(define (list->triples a-list)
(cond
[(= (length a-list) 1) empty]
[else (cons (list (first a-list) (second a-list) my-color) (list->triples (rest a-list)))]
)
)
When I apply it to (list (make-posn 10 10) (make-posn 10 20)) I get
(list (list (make-posn 10 10) (make-posn 10 20) 'black))
as expected, but when I add more posns to the list I get the following:
(shared ((-4- (make-posn 10 20))) (list (list (make-posn 10 10) -4- 'black) (list -4- (make-posn 20 20) 'black)))
which I find confusing.
It clearly behaves like the list I need, as it can be drawn in the expected way, but I just don't get what (shared ...) is and why my function returns this type of value.
My only clue is that it should be related to the presence of posns in the list, as I do not get the same behaviour with lists of symbols.
Just in case this is relevant: I'm using the HTDP-advanced teaching language.
Can anyone clarify why I get this type of output?