This file contains hidden or 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 | |
;; Let's write an untyped Racket module that works fine when `require`d | |
;; by untyped Racket. But also, let's try to use it from Typed Racket. | |
(provide foo | |
macro-foo) | |
;; A user may `require/type` this _function_, and it works fine. | |
(define (foo x) |
This file contains hidden or 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
<html> | |
<head> | |
</head> | |
<body> | |
<p>Hello, world.</p> | |
</body> | |
</html> |
This file contains hidden or 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 (for-syntax syntax/parse | |
(only-in racket/syntax with-syntax*))) | |
;; Transform (fun a _ c _ e) => (lambda (b d) (fun a b c d)) | |
(define-syntax (myapply stx) | |
(define (placeholder? stx) | |
(equal? (syntax-e stx) '_)) | |
(syntax-parse stx |
This file contains hidden or 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 | |
;; This is boiled down to single file with module. | |
;; | |
;; The issue is more obvious when it's a separate file, and the error | |
;; message is for the wrong file as well as line number. | |
(module mod racket | |
(require (for-syntax racket/syntax | |
syntax/parse)) |
This file contains hidden or 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
raco setup: --- building documentation --- | |
raco setup: running: <pkgs>/racket-doc/scribblings/reference/reference.scrbl | |
raco setup: 1 running: <pkgs>/racket-doc/compatibility/scribblings/compatibility.scrbl | |
raco setup: 2 running: <pkgs>/games/cards/cards.scrbl | |
raco setup: 0 running: <pkgs>/web-server-doc/web-server/scribblings/tutorial/continue.scrbl | |
raco setup: 3 running: <pkgs>/drracket/help/bug-report.scrbl | |
raco setup: 5 running: <pkgs>/algol60/algol60.scrbl | |
raco setup: 4 running: <pkgs>/drracket/browser/browser.scrbl | |
raco setup: 6 running: <pkgs>/racket-index/scribblings/main/acks.scrbl | |
raco setup: 7 running: <pkgs>/racket-doc/scribblings/guide/guide.scrbl |
This file contains hidden or 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
greg@mbp in ~/src/plt/racket on master* | |
$ make | |
if [ "" = "" ] ; \ | |
then make plain-in-place PKGS="main-distribution plt-services" ; \ | |
else make cpus-in-place PKGS="main-distribution plt-services" ; fi | |
make base | |
mkdir -p build/config | |
echo '#hash((links-search-files . ()))' > build/config/config.rktd | |
mkdir -p racket/src/build | |
make racket/src/build/Makefile |
This file contains hidden or 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 rackunit | |
sexp-diff) ;; raco pkg install sexp-diff | |
;; check-equal? doesn't even pretty-print the sexprs, which can be | |
;; very long and hard to compare. Anyway let's do even better and use | |
;; sexp-diff to highlight to diff. | |
(define-syntax (check-sexp-equal? stx) | |
(syntax-case stx () |
This file contains hidden or 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 racket/date) | |
(match "2012-11-07" ;; <- @|date| | |
[(pregexp "(\\d{4})-(\\d{2})-(\\d{2})" (list _ y m d)) | |
(date->string (date 0 0 0 | |
(string->number d) | |
(string->number m) | |
(string->number y) | |
0 0 #f 0))]) |
This file contains hidden or 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
greg@halo:~/src/shriphani-blog$ racket --version | |
Welcome to Racket v5.3.6. | |
greg@halo:~/src/shriphani-blog$ raco pkg show | |
Installation-wide: | |
[none] | |
User-specific, all-version: | |
[none] | |
User-specific, version-specific (5.3.6): | |
Package[*=auto] Checksum Source | |
aws #f (link /home/greg/src/racket/collects/aws) |
This file contains hidden or 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
~/src/blog$ raco frog -Vb | |
Frog 0.8 | |
Using configuration /home/greg/src/blog/.frogrc | |
Very verbose mode | |
Trying to start pygments process | |
Reading _src/posts/2013-07-13-fast-dates-parser.md | |
Reading _src/posts/2013-07-13-new-blog.md | |
Skipping _src/posts/2013-07-13-new-blog.md~ | |
Not named #px"^(\\d{4}-\\d{2}-\\d{2})-(.+?)\\.(?:md|markdown|scrbl)$" | |
Reading _src/posts/2013-07-21-accessing-your-kindle-highlights.md |