[racket-dev] Transparent Structures in XML Library

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Mon Oct 3 18:34:43 EDT 2011

Doug, does this concrete example concerning printing help: 

#lang racket/load 

(module a racket/base
  (struct xml (bar) #:transparent)
  
  (define x (xml "bar"))
  (displayln x)

  (provide (struct-out xml) x))

(module b racket/base
  (require 'a)

  (struct my xml () #:property prop:custom-write (lambda (x p z) (displayln "<my xml>" p)))
  
  (define y (my "bar"))
  
  (displayln y))

(require 'b)





Posted on the dev mailing list.