muszę zdefiniować struct jak poniżej,unikać wyświetlania 3 raz struct
(struct vector (x y z)
#:methods gen:custom-write
[(define (write-proc vector port mode)
(let ([print (if mode write display)])
(write-string "<")
(print (vector-x vector))
(write-string ", ")
(print (vector-y vector))
(write-string ", ")
(print (vector-z vector))
(write-string ">")))])
Ale jestem coraz dziwne zachowanie w REPL gdzie struktura jest bycie Wyświetlacz 3 Czas:
> (define a (vector 1 2 3))
> a
<1, 2, 3><1, 2, 3><1, 2, 3>
Muszę coś zrobić źle, ale nie mogę znaleźć mojego problemu. Czy ktoś może mi wyjaśnić, dlaczego mam 3-krotny wynik?
Dzięki, że nie zwracałem uwagi na e doc :) – mathk