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 switch-hyphen () | |
(interactive) | |
(define-key coq-mode-map (kbd "-") '(lambda () (interactive) (insert "_"))) | |
(define-key coq-mode-map (kbd "_") '(lambda () (interactive) (insert "-")))) | |
(add-hook 'coq-mode-hook 'switch-hyphen) |
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 | |
(define (f x) (cond [#f ;; or some other arbitrary computation that gives #f | |
(g x)] | |
[else x])) | |
(f 0) | |
(define (g x) x) |
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 | |
(require racket/trace | |
(for-syntax syntax/parse)) | |
;; 0CFA in the AAM style on some hairy Church numeral churning | |
;; Soundness, but at what cost? | |
(define <- (case-lambda)) | |
(begin-for-syntax |
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/load | |
(module tweaks racket | |
(require (for-syntax syntax/parse)) | |
(provide <- for/union for*/union for*/set | |
appl fix do join extend get-cont lookup-env lookup P parse | |
compile widen push | |
join-stores s->c c->s | |
(struct-out ev^) | |
(struct-out co^) |
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
(require (for-syntax syntax/parse)) | |
; syntax classes, syntax-parse patterns and unquote-syntax in your define-syntax-rule! | |
(define-syntax (define-syntax-rule* stx) | |
(syntax-parse stx | |
[(_ (name patterns ...) body ...) | |
(syntax/loc stx | |
(define-syntax (name syn) | |
(syntax-parse syn | |
[(_ patterns ...) | |
(quasisyntax/loc syn (begin body ...))])))])) |
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
(setq raco-location "raco") | |
(require 'paredit) | |
(setq raco-doc-history nil) | |
(defun call-raco-doc (text) | |
(shell-command (concat raco-location " doc -- '" text "' &"))) | |
(defun get-current-word () | |
(paredit-handle-sexp-errors | |
(save-excursion |
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 | |
(require racket/unsafe/ops | |
(for-syntax racket/fixnum racket/vector)) | |
(provide fxcount) | |
;; Count set bits for 30 bit number in 5 steps. | |
;; for 62 bit number in 6. | |
(define-for-syntax lut | |
#(#x2AAAAAAA | |
#x0CCCCCCC |
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 | |
(require redex) | |
(define-language L | |
[e x (e e) lam (let ([x e]) e)] | |
[lam (λf (x) e)] | |
[λf λ lambda] | |
[x variable-not-otherwise-mentioned] | |
;; Machine | |
[ρ (side-condition (name ρ any) (hash? (term ρ)))] |
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 | |
(require redex) | |
(define-language L | |
[e x (e e) lam (let ([x e]) e)] | |
[lam (λf (x) e)] | |
[λf λ lambda] | |
[x variable-not-otherwise-mentioned] | |
;; Machine | |
[ρ (side-condition (name ρ any) (hash? (term ρ)))] |
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 | |
(provide main) | |
(require (planet clements/rsound) 2htdp/universe 2htdp/image) | |
;; Helpful app to implement the exercise plan in | |
;; http://well.blogs.nytimes.com/2013/05/09/the-scientific-7-minute-workout/ | |
(define exercises '("Jumping jacks" | |
"Wall sit" | |
"Push ups" |
OlderNewer