From a5a38d89a3d3066bb6b4f30925782410fc2cb3e7 Mon Sep 17 00:00:00 2001 From: Milo Date: Tue, 28 Jan 2020 22:42:03 -0500 Subject: [PATCH] first go --- README.md | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..7cb03c7 --- /dev/null +++ b/README.md @@ -0,0 +1,63 @@ +# Racket "wat"s + +*inspired by Gary Bernhardt's [original "Wat" talk](https://www.destroyallsoftware.com/talks/wat)* + +**This repository is a work in progress. If you have anything new wat's to contribute, or +think one should be removed, please create a pull request!** + +# List of wat's + +- Numbers are mutable + + ```racket +Welcome to Racket v7.5.0.900. +> (immutable? 5) +#f +``` + +- Unquote can be weird: + + ```racket +Welcome to Racket v7.5.0.900. +> `(4 . ,(+ 1 2)) +(4 . 3) +> '(4 . ,(+ 1 2)) +'(4 unquote (+ 1 2)) +``` + +- Argument order for collections: + + ```racket +Welcome to Racket v7.5.0.900. +> (member 'x (list 'x 'y)) +#t +> (vector-member 'x (vector 'x 'y)) +#t +> (set-member? (set 'x 'y) 'x) +#t +``` + +- `gensym` is special + + ```racket +Welcome to Racket v7.5.0.900. +> (define x (gensym)) +> x +'g78 +> (eq? x 'g78) +#f +``` + +- `hash-map` doesn't return a hash + + ```racket +Welcome to Racket v7.5.0.900. +> (map list '(1 2 3)) +'((1) (2) (3)) +> (vector-map list #(1 2 3)) +'#((1) (2) (3)) +> (hash-map (hash 'x 1 'y 2) list) +'((x 1) (y 2)) ; that's not a hash map... +``` + +- **TODO** more