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
| open import Data.Nat | |
| open import Data.Bool hiding (_<_) | |
| open import Data.List | |
| open import Data.Fin hiding (_<_; _+_) | |
| open import Data.Unit | |
| open import Relation.Nullary | |
| open import Data.Product | |
| open import Relation.Binary.PropositionalEquality | |
| -- What is a semantics? A semantics defines the meaning of terms. |
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/base | |
| (require | |
| (for-syntax | |
| racket | |
| syntax/parse) | |
| racket/contracts) | |
| (provide (rename-out [new-define/contract define/contract])) |
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 | |
| racket/syntax)) | |
| ;; unhygenic | |
| (define-syntax (new-define-form syn) | |
| (syntax-parse syn |
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
| \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 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 | |
| ;; ------------------------------------------------------------------------ | |
| ;; Template helpers | |
| ;; ------------------------------------------------------------------------ | |
| (define-syntax (.... stx) | |
| (syntax-case stx () | |
| [_ | |
| #`(error "Incomplete template at line" #,(syntax-line 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 | |
| (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 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 (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 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 | |
| (provide fact) | |
| (define (fact n) | |
| (apply * (build-list n add1))) |
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 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 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 s-exp "redex-lang.rkt" | |
| (axiom x : Nat) | |
| (axiom y : Nat) | |
| (lambda ((x : Nat)) y) | |
| ((lambda ((x : Nat)) y) 0) | |
| ; type error |