I am writing an interpreter for R7RS Scheme to gain a more complete understanding of the Scheme programming language.
From my understanding, eqv?
must return #t
if both list arguments denote the same location in memory. However, I am not sure if the cdr
of a list must always be eqv:
(define l '(a b c))
(eqv? (cdr l) (cdr l)) ; #t of #f?
The missing part of my knowledge is whether or not the cdr
of a particular list must always point to a particular location. For a particular list, must cdr
always return an identical sublist every time it is called on the list, or can it return a completely new sublist?
(I understand that I can test this empirically using existing Scheme interpreters, but I am mainly interested in what the standard mandates).