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 net/url | |
racket/match) | |
(define pkgs | |
(let ([pkgs (call/input-url (string->url "https://pkgs.racket-lang.org/pkgs-all") | |
get-pure-port | |
read)]) | |
(for/fold ([pkgs pkgs]) |
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
(use-package racket-mode | |
:load-path "~/src/elisp/racket" | |
:config (progn | |
(cond (macosx-p | |
(setq racket-racket-program "racket" | |
racket-raco-program "raco")) | |
(linux-p | |
(setq racket-racket-program "/usr/racket/bin/racket" | |
racket-raco-program "/usr/racket/bin/raco"))) | |
(setq racket-error-context 'high) |
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
(defun racket-at-expression-paredit-space-for-delimiter-predicate (endp delimiter) | |
"`paredit-mode' shouldn't insert space before [ or { in Racket at-expressions. | |
For example: | |
@[] | |
@{} | |
@[]{} | |
@foo[] | |
@foo{} |
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
;; A "Rackety" version of http://stackoverflow.com/a/33557880/343414 | |
#lang racket | |
(require rackunit) | |
(define (unwind xs) | |
(let loop ([right '()] [turtle xs] [hare xs]) | |
(match* (hare turtle) | |
[((list) ts ) (interleave right ts)] |
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
(defun chandler/buffer-local-tab-complete () | |
"Make `tab-always-indent' a buffer-local variable and set it to 'complete." | |
(make-local-variable 'tab-always-indent) | |
(setq tab-always-indent 'complete)) | |
(add-hook 'racket-mode #'chandler/buffer-local-tab-complete) | |
(add-hook 'racket-repl-mode #'chandler/buffer-local-tab-complete) |
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
(module simple racket | |
(+ 1 1)) | |
;; Fully expanded | |
(module simple racket | |
(#%module-begin | |
(module configure-runtime '#%kernel | |
(#%module-begin (#%require racket/runtime-config) (#%app configure '#f))) | |
(#%app call-with-values (lambda () (#%app + '1 '1)) print-values))) |
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
@namespace url(http://www.w3.org/1999/xhtml); | |
@-moz-document url-prefix("https://github.com/") { | |
.pl-c{ | |
color: #222 !important; | |
} | |
.pl-c1,.pl-mdh,.pl-mm,.pl-mp,.pl-mr,.pl-s1 .pl-v,.pl-s3,.pl-sc,.pl-sv{ | |
color: #222 !important; |
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
#!/usr/bin/env racket | |
#lang racket/base | |
(require racket/performance-hint | |
racket/list | |
racket/port | |
racket/promise) | |
;;; Norvig's spelling corrector |
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
#:keyword | |
#t | |
#f | |
(parens) | |
[brackets] | |
{brackes} |