Skip to content

Instantly share code, notes, and snippets.

View schuster's full-sized avatar

Jonathan Schuster schuster

View GitHub Profile
@schuster
schuster / gist:5716842
Created June 5, 2013 20:04
Demonstration of a custom reduction strategy (apply-reduction-relation*/random)
#lang racket
(require redex)
(define (apply-reduction-relation*/random rel t)
(define results (apply-reduction-relation rel t))
(cond [(null? results) (list t)]
[else (apply-reduction-relation*/random rel (list-ref results (random (length results))))]))
@schuster
schuster / gist:c6c8e49eb1d887b2dbf1
Created December 12, 2014 18:39
Racket IRC crash
[blackrock components]% tcp-read: error reading
system error: Connection timed out; errno=110
context...:
/home/schu/projects/racket-irc/irc/main.rkt:41:12: loop
@schuster
schuster / meta-not-found.rkt
Created March 11, 2016 15:34
Meta not found example
#lang racket
(require nanopass)
(define-language L
(terminals
(number (n)))
(Exp (e)
n
(+ e e)))
@schuster
schuster / ellipsis-parsing.rkt
Created March 11, 2016 16:57
Multiple ellipsis error
#lang racket
(require nanopass)
(define-language L
(terminals
(number (n))
(symbol (x)))
(Exp (e) (n ... x ...)))
@schuster
schuster / rackunit-loc-test.rkt
Created July 27, 2016 19:52
Wrong location reported by test macro
#lang racket
(require
rackunit
(for-syntax syntax/parse))
(define-simple-check (check-foo? actual)
(equal? actual 'foo))
(define-syntax (test-foo? stx)