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
// Sketching a three-class world for Measure + Decimal with | |
// | |
// 1. IEEE 754 Decimal128 class, with no arithmetic, (mathematical) equality checking only, formatting | |
// 2. Decimal class (normalized subset of IEEE 754 Decimal128), with arithmetic, comparisons, formatting | |
// 3. Measure class (minimal in 262, fleshed out in 402), no arithmetic | |
type RoundingMode = | |
| "ceil" | |
| "floor" | |
| "trunc" |
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
// Sketching a two-class world for Measure + Decimal with | |
// | |
// 1. A Decimal class (normalized subset of IEEE 754 Decimal128), with arithmetic, comparisons, formatting | |
// 2. A Measure class (minimal in 262, fleshed out in 402), no arithmetic | |
type RoundingMode = | |
| "ceil" | |
| "floor" | |
| "trunc" | |
| "halfEven" |
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
export declare class Decimal128 { | |
constructor(value: string | number | bigint | NormalizedDecimal128); | |
// predicates | |
isFinite(): boolean; | |
isNegative(): boolean; | |
isNaN(): boolean; | |
isZero(): boolean; | |
// comparison |
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/list | |
web-server/http | |
web-server/servlet-env | |
web-server/dispatch | |
json) | |
#| | |
Our database will be an (eq) hash table whose keys are symbols. |
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 http) ;; not installed by default | |
;; do raco pkg install http | |
(define (http-request uri | |
#:redirects [redirects 10] | |
#:http-version [http-version "1.1"] | |
#:method [method "GET"] | |
#:data [data #""] |
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 web-server/servlet | |
web-server/servlet-env | |
web-server/templates) | |
(define html-utf-8-mime-type | |
"text-html; charset=utf-8") | |
(define html-utf-8-mime-type/bytes |
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 | |
(define (env) | |
;; Association list of the current environvment variables and their values. | |
;; | |
;; NB: Both the car and the cdr of the returned cons cells are byte strings, | |
;; not simply strings. If you're looking for strings, you'll need to do | |
;; a bit of work. | |
(define (names env) | |
(environment-variables-names env)) |
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
<reddit-user-info status="public" date="YYYY-MM-DD" timezone="UTC" username="USERNAME"> | |
<karma posts="postkarma" comments="commentkarma" total="totalkarma"/> | |
<subreddit-catalog> | |
<subreddit name="name" status="status" link="https://www.reddit.com/r/Example/"> | |
<modstatus permissions="none"/> | |
</subreddit> | |
</subreddit-catalog> | |
</reddit-user-info> |