That's correct. Quoted values get GCed when code gets GCed, such as
when you run a module to completion in a namespace and don't retain the
namespace, or when a quoted value is sent to `eval` and not part of a
definition.
At Thu, 7 Sep 2017 17:31:26 -0700, Alexis King wrote:
> My understanding is
My understanding is that quoted values are effectively interned, so
they’ll never be garbage collected as long as the code containing the
quoted expression is loaded. Here’s a program that hints at this:
(define (make-quoted-value)
'(1 . 2))
(eq? (make-quoted-value)
(make-quoted-va
Ran into some unexpected behavior today. Quoted values do not seem to
be garbage collected when there are only weak references. Is this
correct behavior?
Here's an example program:
#lang racket/base
(define key1 (list 1))
(define key2 '(1))
(define hash1 (make-weak-hash (list (cons key1 1
3 matches
Mail list logo