convertible.scrbl (340B)
1 #lang scribble/base 2 @(require file/convertible) 3 4 @(struct s () 5 #:property 6 prop:convertible 7 ;; Not actually convertible to anything: 8 (lambda (v req default) 9 default)) 10 11 @(struct c () 12 #:property 13 prop:convertible 14 (lambda (v req default) 15 (cond 16 [(eq? req 'text) "hello"] 17 [else default]))) 18 19 @(s) 20 21 @(c)