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 | |
(define (f a) '()) | |
(define (f0 a b c x) '()) | |
(define (f1 a b c x #:y [y 'y]) '()) | |
(define (f2 a b c x #:y y) '()) | |
(define (identity x) x) | |
(define-syntax-rule (time-it wrap ...) |
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 | |
(provide text-lines? | |
(rename-out [empty empty-text-lines]) | |
;; 0 is the position before everything, and the position | |
;; after a newline is on the subsequent line | |
text-length ; t -> position at end | |
insert ; t position str -> t, detecting "\n" |
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 rhombus | |
;« | |
import:« | |
rhombus/macro:« no_prefix»»; | |
use_static_dot; | |
// Some expressions | |
10 * (-3) + 2; |
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 () | |
(define work-dir (make-temporary-file "deputy-check-~a" 'directory)) | |
(define m '(module m racket/base | |
(provide m) | |
(define (m) '(this is m)))) | |
(define n '(module n racket/base |
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
_let pair = _fun (a) _fun (b) | |
_fun(sel) | |
_if sel _then a _else b | |
_in _let fst = _fun (p) p(_true) | |
_in _let snd = _fun (p) p(_false) | |
_in _let fib = _fun (fib) | |
_fun (x) | |
_if x == 0 | |
_then pair(1)(1) | |
_else _if x == 1 |
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
_let fib = _fun (fib) | |
_fun (x) | |
_if x == 0 | |
_then 1 | |
_else _if x == 1 | |
_then 1 | |
_else fib(fib)(x + -2) + fib(fib)(x + -1) | |
_in fib(fib)(30) |
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 ffi/unsafe | |
racket/class | |
ffi/unsafe/alloc | |
ffi/unsafe/try-atomic | |
ffi/unsafe/schedule | |
"utils.rkt" | |
"types.rkt" | |
"const.rkt" | |
"key.rkt" |
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
let | x : 1 | |
| y : 2 | |
in : | |
(x + y) | |
define pi : 3.14 | |
define fib(n) : | |
log_error("fib called") | |
cond | (n = 0) : 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
let (x = 1, | |
y = 2): | |
x+y | |
// I'd be tempted to write it like this, though | |
let (x = 1, | |
y = 2) | |
: x+y | |
define pi = 3.14 |
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
Designated "statement" grouping operators with precedence from | |
strongest to weakest: | |
, => = & | : | |
Examples, showing intended use followed by full parenthesization: | |
define : f(s) = | |
printf("hi ~a\n", s), | |
"hi" |
NewerOlder