module scheme import reader // Graph materialization only visits nodes reachable from this subform. The // existing backend supplies iterative construction, sharing and cycle support. // Newly built pair/vector structure is mutable; retained source atoms preserve // literal immutability. Metadata must retain its normal publication owner. fn syntax_to_datum(value Value) !Value { if value.tag != .syntax { if value.tag == .symbol { return failure('unwrapped symbol is not a syntax identifier') } if value.tag !in [.pair, .vector] { return value } return map_syntax_value_graph(value, false, unsafe { nil }, unsafe { nil }, unsafe { nil }) } object := syntax_object_ref(value)! if object.data.tree.nodes[object.index].kind !in [.pair, .vector] { return graph_source_atom(object.data.tree, reader.NodeId(object.index)) } mut jobs := new_datum_graph_jobs() defer { jobs.release() } mut cache := new_scratch_datum_cache(jobs.storage) return materialize_datum_graph_in(object.data.tree, reader.NodeId(object.index), mut cache, false, jobs) }