Skip to content

Instantly share code, notes, and snippets.

@edw
Last active December 11, 2018 13:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edw/8c2ec6b24eb58ecd699af3bdc8a99316 to your computer and use it in GitHub Desktop.
Save edw/8c2ec6b24eb58ecd699af3bdc8a99316 to your computer and use it in GitHub Desktop.
Sketch of how Scheme might be adapted to enhanced, Clojure-style reader

Sketch of how Scheme might be adapted to enhanced, Clojure-style reader

Multiple procedure arities

;; Clojure
(defn add
  ([] 0)
  ([x] x)
  ([x y] (+ x y))
  ([x y z & rest] (apply + x y z rest)))
;; Enhanced S-Expression Scheme:
(define-proc add
  ([] 0)
  ([x] x)
  ([x y] (+ x y))
  ([x y z & rest] (apply + x y z rest)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment