| 1 | module scheme |
| 2 | |
| 3 | // Syntax may be partially unwrapped pair/vector structure. Existing wrapped |
| 4 | // fragments retain their exact handles; only ordinary symbols gain context. |
| 5 | fn datum_to_syntax(template Value, datum Value) !Value { |
| 6 | info := syntax_identifier_info(template)! |
| 7 | object := syntax_object_ref(template)! |
| 8 | if datum.tag !in [.pair, .vector, .symbol] { return datum } |
| 9 | return map_anchored_syntax_value_graph(datum, true, syntax_identifier_context(template)!, info.wrap, object.data.owner, info) |
| 10 | } |
| 11 | |