Skip to content

Instantly share code, notes, and snippets.

@LeifAndersen
Created November 19, 2018 23:42
Show Gist options
  • Save LeifAndersen/0d6a3a00ef4f90dc6a3f043adebac0ea to your computer and use it in GitHub Desktop.
Save LeifAndersen/0d6a3a00ef4f90dc6a3f043adebac0ea 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)
(begin
(error "Shouldn't be an internal error")
#'(list 'a 'b))]))
(f 3 blue))))))
(define (def-mixin super%)
(class super%
(inherit get-next-settings)
(super-new)
(parameterize ([current-namespace (make-empty-namespace)])
(drracket:eval:expand-program inp
(get-next-settings)
#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