Skip to content

Instantly share code, notes, and snippets.

@joelmccracken
Created December 23, 2008 17:20
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 joelmccracken/39384 to your computer and use it in GitHub Desktop.
Save joelmccracken/39384 to your computer and use it in GitHub Desktop.
(define-syntax begin2
(syntax-rules ()
[(begin2 a) (a)]
[(begin2 a b ...) ((begin3 b ...) a)]))
(define-syntax begin3
(syntax-rules ()
[(begin3 a) (lambda (unique-plz) a)]
[(begin3 a b ...) (lambda (unique-plz) ((begin3 b ...) a))]))
; example code, displaying the abilities of function composition and macros.
(begin2 (display "1") (display "2") (display "3") (display "4") (display "5") (display "6") (+ 2 3))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment