Skip to content

Instantly share code, notes, and snippets.

View johnwcowan's full-sized avatar
💭
Chief cook and bottle washer

John Cowan johnwcowan

💭
Chief cook and bottle washer
View GitHub Profile
@johnwcowan
johnwcowan / bang.scm
Created October 7, 2020 20:02
The K language's ! operator in Scheme, or, Polymorphism gone wild
(import (srfi 1))
;; The K language's polymorphic ! operator
(define bang
(case-lambda
((x)
(iota x))
((x y)
(cond
((exact-integer? y)