Last active
December 20, 2015 16:09
-
-
Save takikawa/6159756 to your computer and use it in GitHub Desktop.
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
;; goes in .racketrc | |
(define current-cow-flags (make-parameter "")) | |
(define old-print (current-print)) | |
(define (print-with-cowsay val [port (current-output-port)]) | |
(define output (with-output-to-string (thunk (old-print val)))) | |
(when (not (string=? "" output)) | |
(match-define | |
(list in _ _ _ _) | |
(process (format "cowsay ~a \"~a\"" (current-cow-flags) output))) | |
(display (port->string in) port))) | |
(current-print print-with-cowsay) | |
(define old-error-display-handler (error-display-handler)) | |
(error-display-handler | |
(λ (string val) | |
(parameterize ([current-cow-flags "-f flaming-sheep"]) | |
(print-with-cowsay string (current-error-port))) | |
(old-error-display-handler "" val))) | |
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
$ racket | |
Welcome to Racket v5.90.0.4. | |
-> (list 1 2 3) | |
___________ | |
< '(1 2 3) > | |
----------- | |
\ ^__^ | |
\ (oo)\_______ | |
(__)\ )\/\ | |
||----w | | |
|| || | |
--> (/ 1 0) | |
______________________ | |
< /: division by zero > | |
---------------------- | |
\ . . . | |
\ . . . ` , | |
\ .; . : .' : : : . | |
\ i..`: i` i.i.,i i . | |
\ `,--.|i |i|ii|ii|i: | |
UooU\.'@@@@@@`.||' | |
\__/(@@@@@@@@@@)' | |
(@@@@@@@@) | |
`YY~~~~YY' | |
|| || | |
; [,bt for context] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment