Skip to content

Instantly share code, notes, and snippets.

@deeglaze
Created July 15, 2014 20:11
Show Gist options
  • Save deeglaze/6ae7424cc2d093661df2 to your computer and use it in GitHub Desktop.
Save deeglaze/6ae7424cc2d093661df2 to your computer and use it in GitHub Desktop.
probably won't happen (?)
#lang racket
(require (for-syntax racket/struct-info))
(define-values (s:p mkp recp refp setp)
(make-struct-type 'parent #f 1 0 #f))
(define-values (s:c mkc recc refc setc)
(make-struct-type 'child s:p 1 0 #f))
(define (refc0 c) (refc c 0))
(define-syntax P 'gotcha!)
(define-syntax C
(make-struct-info (λ ()
(list #'s:c #'mkc #'recc
(list #'refc0 #f)
(list #f #f)
#'P))))
(struct-copy C (mkc 0 1) [mumble #:parent s:p 'blah])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment