Skip to content

Instantly share code, notes, and snippets.

@LeifAndersen
Created November 19, 2018 23:23
Show Gist options
  • Select an option

  • Save LeifAndersen/59852e811826715a50f2108dde526cbc to your computer and use it in GitHub Desktop.

Select an option

Save LeifAndersen/59852e811826715a50f2108dde526cbc to your computer and use it in GitHub Desktop.
#lang at-exp racket/unit
(require drracket/tool
racket/port
racket/format
racket/class)
(import drracket:tool^)
(export drracket:tool-exports^)
(define inp
(open-input-string
(~a "#lang racket\n"
(apply
~s
'((define-syntax (f stx)
(syntax-case stx ()
[(_ a b) #'(list 'a 'b)]))
(f 3 blue))))))
(define (def-mixin super%)
(class super%
(super-new)
(parameterize ([current-namespace (make-empty-namespace)])
(define next (send this get-next-settings))
(drracket:eval:expand-program inp next #t void void
(λ (data next)
(writeln data)
(next))))))
(define (phase1) (void))
(define (phase2) (void))
(drracket:get/extend:extend-definitions-text def-mixin)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment