Created
February 2, 2021 23:19
-
-
Save srcreigh/a0a087adc26e15af0160e8866d48cd1c to your computer and use it in GitHub Desktop.
How to add static compilation errors to Racket
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 racket/base | |
(require (for-syntax racket/base syntax/parse)) | |
(define-syntax (error stx) | |
(syntax-parse stx | |
[(_ ...) (raise-syntax-error #f "This is an error." stx)])) | |
;; The following line will be highlighted in the IDE and say "This is an error." | |
;; in DrRacket or racket-xp-mode for emacs. | |
(error 'hi) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment