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 | |
(for-syntax | |
syntax/parse | |
racket/syntax)) | |
;; unhygenic | |
(define-syntax (new-define-form syn) | |
(syntax-parse syn |
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
\NeedsTeXFormat{LaTeX2e} | |
\ProvidesClass{jfp}[2020/07/23 V1.6 Standard LaTeX document class] | |
% | |
\newif\ifcopoddhead\global\copoddheadfalse | |
\newif\ifOA\global\OAfalse | |
\newif\ifnolineno\global\nolinenofalse | |
\newif\ifnatbiboff\global\natbibofffalse | |
\newif\ifeqnum\global\eqnumfalse | |
\newif\ifkeyedin\global\keyedinfalse | |
\newif\iffirstproof\global\firstprooffalse |
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 | |
;; ------------------------------------------------------------------------ | |
;; Template helpers | |
;; ------------------------------------------------------------------------ | |
(define-syntax (.... stx) | |
(syntax-case stx () | |
[_ | |
#`(error "Incomplete template at line" #,(syntax-line stx))])) |
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 (for-syntax racket/syntax)) | |
#| | |
1,000 fvars; let-syntax implementation | |
cpu time: 1162 real time: 1165 gc time: 156 | |
10,000 fvars; let-syntax implementation | |
cpu time: 10928 real time: 10964 gc time: 1374 |
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 (rename-in racket/base [+ r:+])) | |
(provide +) | |
(define (join e1 e2) | |
(cond | |
[(and (number? e1) (number? e2)) | |
number?] | |
[(and (number? e1) (symbol? e2)) |
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 fact) | |
(define (fact n) | |
(apply * (build-list n add1))) |
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 sweet-exp racket | |
require (rename-in racket/base [+ r:+]) | |
define +(e . rest) | |
cond | |
string? e | |
apply string-append e rest | |
number? e | |
apply r:+ e rest |
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 s-exp "redex-lang.rkt" | |
(axiom x : Nat) | |
(axiom y : Nat) | |
(lambda ((x : Nat)) y) | |
((lambda ((x : Nat)) y) 0) | |
; type error |
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 s-exp "interp.rkt" | |
(define f (lambda (x) #t)) | |
(f #f) |
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 racket/local) | |
(provide | |
;; the language, with some bits to demonstrate renaming in case you need to use Racket built-ins with the same name | |
true false | |
(rename-out [new-if if]) | |
;; basic Racket stuff to get module with top-level expressions | |
#%module-begin | |
#%top |