bkyk8rc3zvpnsf5inmcqq4n3k98cv6hj-my-site-hyper-literate-git.test.suzanne.soy-0.0.1

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

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)