Skip to content
a racket macro that allows definitions to be spread across a file
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

define-match-spread-out Build Status


A racket library that allows you to write code like this:

(define* (f #t) 2)
(define* (f #f) 3)
(define* (f  _) 0)
(define* (f x y) x)

That would be roughly equivalent to

(define f
    [[#t] 2]
    [[#f] 3]
    [[_] 0]
    [[x y] x]))

Or, using just case-lambda and match variants:

(define f
     (match tmp
       [#t 2]
       [#f 3]
       [_  0])]
    [(tmp1 tmp2)
     (match* (tmp1 tmp2)
       [(x y) x])]))
You can’t perform that action at this time.