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
;; List of high-frequency English words. | |
;; Taken from John Clement's morse-code library | |
;; https://github.com/jbclements/morse-code-trainer/blob/master/morse-code-trainer/frequency.rktd | |
( | |
"the" | |
"be" | |
"and" | |
"of" | |
"to" | |
"a" |
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 | |
;; Testing 3 implementations of string-contains? | |
;; 1. Using a simple regular expression | |
;; 2. Using a for loop | |
;; 3. Using a let loop | |
;; To run the freq-test, you'll want to download the file "common-words.rktd" | |
;; from this gist: https://gist.github.com/bennn/7efd60b4809a475af297 |
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 | |
(module trie typed/racket | |
(provide lookup bind trie insert Trie tries) | |
(require racket/match) | |
(define-type-alias (Key A) (Listof A)) | |
(define-struct: Mt ()) | |
(define-struct: (A) Some ([elem : A])) |
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 | |
;; Minimized version of `good-news.rkt` | |
;; Runs on (slowly) on 6.3, crashes on 6.3.0.11 | |
;; | |
;; Error message: | |
;; vector-ref: chaperone produced a result that is not a chaperone of the original result | |
;; chaperone result: (object:automata% ...) | |
;; original result: (object:automata% ...) | |
;; context...: |
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 | |
;; Apparently builds repeated wrappers | |
;; when comparing a recursive contract to an "opaque" recursive contract | |
;; | |
;; (object/c (-> evaluate ... (object/c (-> evaluation ... | |
;; vs | |
;; (recursive-contract g27 #:impersonator) | |
;; | |
;; Not sure where the recursive contract came from |
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 | |
(module automata racket/base | |
(provide | |
choose-randomly | |
build-automata) | |
(require racket/class racket/match) | |
(define (choose-randomly vals num-to-choose) |
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 | |
;; Repeatedly passes an object through a simple type boundary. | |
(define OPAQUE-TIME 1) | |
(define ITERS 30000) | |
(module t typed/racket/base | |
(require typed/racket/class) | |
(define-type C% (Class (f (-> C C)))) |
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 | |
(prefix-in - (only-in racket/base struct)) | |
(for-syntax syntax/parse racket/syntax)) | |
(define-syntax (struct stx) | |
(syntax-parse stx | |
[(_ name (field* ...) other-arg* ...) | |
#:with define-name (format-id stx "define-~a" (syntax-e #'name)) | |
#:with (name-field ...) (for/list ([field (in-list (syntax-e #'(field* ...)))]) |
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 rosette | |
;; Posted to Coq-Club by Fred Smith, 2016-09-24 | |
;; https://sympa.inria.fr/sympa/arc/coq-club/2016-09/msg00185.html | |
;; The five-story Manning Building, located in the Wall Streat area of | |
;; Manhattan, houses the home offices of Matt and four other prominent | |
;; businessmen. | |
;; | |
;; Each man's business is located on a different floor of the building, and each |
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 file/glob pict racket/draw) | |
(define (path->pict path) | |
(bitmap (make-object bitmap% path 'png))) | |
(define p | |
(parameterize (#;[current-directory (build-path "Users" "ben" "Desktop")]) | |
(apply vc-append 20 (map path->pict (glob "/Users/ben/Desktop/Screen*png"))))) |
OlderNewer