Created
September 12, 2014 17:36
-
-
Save gatlin/44c5d00695a69316deda to your computer and use it in GitHub Desktop.
Simple macro for Typed Racket which makes definitions look nicer to me
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang typed/racket | |
(define-syntax (= stx) | |
(syntax-case stx () | |
[(= sym expr) | |
#'(define sym expr)] | |
[(= sym (arg ...) expr) | |
#'(define (sym arg ...) expr)])) | |
;; example usage | |
(: lang String) | |
(= lang "Typed Racket") | |
(: square (-> Number Number)) | |
(= square (x) (* x x)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment