Skip to content

Instantly share code, notes, and snippets.

Avatar

Neil Toronto ntoronto

View GitHub Profile
@ntoronto
ntoronto / inline-merge-sort.rkt
Created Aug 24, 2012
A macro that expands to a fully inlined merge sort
View inline-merge-sort.rkt
#lang racket
(require (for-syntax racket/list)) ; for list functions
(define-syntax (inline-sort stx)
(syntax-case stx ()
[(_ lst ...)
(with-syntax ([(vs ...) (generate-temporaries #'(lst ...))])
#`(let ([vs lst] ...)
#,(inline-sort/k #'(vs ...) (λ (vs) #`(values #,@vs)))))]))
You can’t perform that action at this time.