├── .gitignore ├── LICENSE ├── README ├── info.rkt ├── racket-cheat.css ├── racket-cheat.rkt └── racket-cheat.scrbl /.gitignore: -------------------------------------------------------------------------------- 1 | # Racket compiled files 2 | compiled/ 3 | 4 | # common backups, autosaves, lock files, OS meta-files 5 | *~ 6 | \#* 7 | .#* 8 | .DS_Store 9 | *.bak 10 | TAGS 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This code is available according to same terms as Racket: 2 | 3 | http://download.racket-lang.org/license.html 4 | 5 | Copyright © Jay McCarthy 6 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | racket-cheat - a cheat sheet for Racket 2 | 3 | INSTALL: 4 | $ raco pkg install racket-cheat 5 | 6 | Look at the top of your docs 7 | 8 | Recently built version here: 9 | 10 | http://pkg-build.racket-lang.org/doc/racket-cheat/ 11 | -------------------------------------------------------------------------------- /info.rkt: -------------------------------------------------------------------------------- 1 | #lang info 2 | (define collection "racket-cheat") 3 | (define deps '("base" 4 | "scribble-lib" 5 | )) 6 | (define build-deps '("db-doc" 7 | "db-lib" 8 | "drracket" 9 | "net-doc" 10 | "net-lib" 11 | "parser-tools-doc" 12 | "parser-tools-lib" 13 | "pict-doc" 14 | "pict-lib" 15 | "racket-doc" 16 | "sandbox-lib" 17 | "slideshow-doc" 18 | "slideshow-lib" 19 | )) 20 | (define scribblings '(("racket-cheat.scrbl" () (getting-started)))) 21 | (define pkg-desc "a cheat sheet for Racket") 22 | (define pkg-authors '(jay)) 23 | 24 | (define license 25 | '(Apache-2.0 OR MIT)) 26 | -------------------------------------------------------------------------------- /racket-cheat.css: -------------------------------------------------------------------------------- 1 | div.main > h2 { 2 | display: none; 3 | } 4 | 5 | .SAuthorListBox { 6 | display: none; 7 | } 8 | 9 | .maincolumn { 10 | margin-right: 0em; 11 | max-width: 900px; 12 | } 13 | 14 | div.Csheet { 15 | display: -webkit-flex; 16 | display: flex; 17 | flex: 1; 18 | -webkit-flex: 1; 19 | } 20 | 21 | div.Ccolumn { 22 | display: flex; 23 | flex: 0 0 50%; 24 | -webkit-flex: 0 0 50%; 25 | margin-left: 0.5em; 26 | margin-right: 0.5em; 27 | flex-wrap: wrap; 28 | flex-direction: column; 29 | } 30 | 31 | div.Ccolumn#Cleft { 32 | order: -1; 33 | } 34 | 35 | div.Csection { 36 | min-width: 50%; 37 | background: #ccb; 38 | padding-left: 0.25em; 39 | padding-right: 0.25em; 40 | padding-top: 0.25em; 41 | padding-bottom: 1em; 42 | margin-bottom: 1em; 43 | } 44 | 45 | div.Csection > h1 { 46 | font-weight: bold; 47 | font-size: 1.3em; 48 | margin: 0; 49 | } 50 | 51 | div.Cgroup { 52 | } 53 | 54 | div.Cgroup > h2 { 55 | font-weight: bold; 56 | font-size: 1.1em; 57 | margin: 0; 58 | padding-top: 0.25em; 59 | } 60 | 61 | div.Cgroup > table { 62 | background: hsl(60, 29%, 94%); 63 | width: 100%; 64 | font-size: 90%; 65 | } 66 | 67 | div.Cgroup > table td { 68 | border: 1px solid hsl(60, 29%, 80%); 69 | padding: 1px; 70 | } 71 | 72 | 73 | div.Cgroup > table tr:nth-child(even) { 74 | background: hsl(60, 29%, 97%); 75 | } 76 | 77 | div.Cgroup > table tr:nth-child(odd) { 78 | } 79 | -------------------------------------------------------------------------------- /racket-cheat.rkt: -------------------------------------------------------------------------------- 1 | #lang racket/base 2 | (require racket/list 3 | racket/match 4 | racket/runtime-path 5 | scribble/core 6 | scribble/base 7 | scribble/html-properties) 8 | 9 | (struct *section (which label groups)) 10 | (struct *group (label rows)) 11 | (struct *row (label content)) 12 | 13 | (define how-many-sections (box 0)) 14 | (define rsections (box empty)) 15 | 16 | (define (CSection #:which which label . groups) 17 | (set-box! rsections 18 | (cons (*section which label groups) 19 | (unbox rsections))) 20 | (set-box! how-many-sections 21 | (add1 (unbox how-many-sections)))) 22 | (define (CGroup label . rows) 23 | (*group label rows)) 24 | (define (CRow label content) 25 | (*row label content)) 26 | 27 | (define-runtime-path racket-cheat.css-path "racket-cheat.css") 28 | 29 | (define cheat-style 30 | (style #f (list (html-defaults #"" #"" '())))) 31 | 32 | (define (render-cheat-sheet) 33 | (define left-col '()) 34 | (define right-col '()) 35 | (for ([s (in-list (unbox rsections))]) 36 | (if (eq? 'left (*section-which s)) 37 | (set! left-col (cons s left-col)) 38 | (set! right-col (cons s right-col)))) 39 | 40 | (element 41 | (style #f (list (alt-tag "div") 42 | (attributes '([class . "Csheet"])) 43 | (css-style-addition racket-cheat.css-path))) 44 | (list 45 | (render-column "Cleft" left-col) 46 | (render-column "Cright" right-col)))) 47 | 48 | (define (render-column id secs) 49 | (element (style #f (list (alt-tag "div") 50 | (attributes `([id . ,id] 51 | [class . "Ccolumn"])))) 52 | (list (map render-section secs)))) 53 | 54 | (define (render-section s) 55 | (match-define (*section _ label gs) s) 56 | (element (style #f (list (alt-tag "div") 57 | (attributes '([class . "Csection"])))) 58 | (cons 59 | (toc-target-element (style #f (list (alt-tag "h1"))) label 60 | `(section ,(content->string label))) 61 | (map render-group gs)))) 62 | 63 | (define (render-group g) 64 | (match-define (*group label rs) g) 65 | (define more 66 | (element (style #f (list (alt-tag "table"))) 67 | (map render-row rs))) 68 | (element (style #f (list (alt-tag "div") 69 | (attributes '([class . "Cgroup"])))) 70 | (if label 71 | (list (element (style #f (list (alt-tag "h2"))) label) 72 | more) 73 | more))) 74 | 75 | (define (render-row r) 76 | (match-define (*row label content) r) 77 | (element (style #f (list (alt-tag "tr"))) 78 | (list (element (style #f (list (alt-tag "td"))) 79 | (list label)) 80 | (element (style #f (list (alt-tag "td"))) 81 | content)))) 82 | 83 | (define MORE 84 | (element (style #f (list (hover-property "Click on the previous 85 | function to see similar functions in the documentation."))) 86 | "...")) 87 | (define LB (linebreak)) 88 | 89 | (provide cheat-style CSection CGroup CRow render-cheat-sheet MORE LB) 90 | -------------------------------------------------------------------------------- /racket-cheat.scrbl: -------------------------------------------------------------------------------- 1 | #lang scribble/manual 2 | @(require "racket-cheat.rkt" 3 | (for-label racket/base 4 | racket/list 5 | racket/string 6 | racket/format 7 | racket/syntax 8 | racket/port 9 | racket/pretty 10 | racket/sandbox 11 | (only-in ffi/unsafe 12 | ffi-lib _uint32 _fun malloc free) 13 | slideshow 14 | pict/code 15 | syntax/parse 16 | syntax/parse/define 17 | json 18 | (only-in xml read-xml write-xml write-xexpr) 19 | (only-in parser-tools/lex lexer) 20 | (only-in parser-tools/yacc parser) 21 | parser-tools/cfg-parser 22 | db 23 | net/http-client 24 | net/url 25 | net/smtp 26 | net/imap 27 | racket/stxparam 28 | racket/runtime-path 29 | racket/undefined 30 | racket/generator 31 | racket/generic 32 | racket/trait 33 | racket/date 34 | racket/async-channel 35 | drracket/tool-lib)) 36 | 37 | @; XXX maybe tag things with a level and produce multiple versions of 38 | @; the cheat for different levels? or at least use it to color things. 39 | 40 | @title[#:style cheat-style]{Racket Cheat Sheet} 41 | @author{Jay McCarthy} 42 | 43 | @(CSection 44 | #:which 'left 45 | "Essentials" 46 | (CGroup 47 | #f 48 | (CRow "Sites" 49 | @elem{@link["http://racket-lang.org"]{main} 50 | @link["http://download.racket-lang.org"]{download} 51 | @link["http://docs.racket-lang.org"]{docs} 52 | @link["https://github.com/racket"]{git}}) 53 | (CRow "Community" 54 | @elem{@link["https://pkgs.racket-lang.org"]{packages} 55 | @link["https://racket.discourse.group/"]{Discourse} 56 | @link["https://discord.gg/6Zq8sH5"]{Discord} 57 | @link["https://racket-lang.org/#community"]{more...}}) 58 | (CRow @seclink["running-sa" #:doc '(lib "scribblings/reference/reference.scrbl")]{Running} 59 | @elem{Put @racket[#,(hash-lang) #,(racketmodname racket) "Hello, world!"] in @exec{hello.rkt} and run @exec{racket hello.rkt}}))) 60 | 61 | @(CSection 62 | #:which 'left 63 | "Primitives" 64 | (CGroup 65 | "Numbers" 66 | (CRow @seclink["parse-number" #:doc '(lib "scribblings/reference/reference.scrbl")]{Literals} 67 | @elem{integer @code{1} rational @code{ 1/2 } complex @code{1+2i} floating @code{3.14} double @code{6.02e+23} hex @code{#x29} octal @code{#o32} binary @code{#b010101}}) 68 | (CRow "Arithmetic" 69 | @racket[+ - * / quotient remainder modulo add1 sub1 max min round floor ceiling sqrt expt exp log sin #,MORE atan]) 70 | (CRow "Compare" 71 | @racket[= < <= > >=]) 72 | (CRow "Bitwise" 73 | @racket[bitwise-ior bitwise-and bitwise-xor bitwise-not arithmetic-shift integer-length]) 74 | (CRow "Format" 75 | @racket[number->string string->number real->decimal-string]) 76 | (CRow "Test" 77 | @racket[number? complex? #,MORE exact-nonnegative-integer? #,MORE zero? positive? negative? even? odd? exact? inexact?]) 78 | (CRow "Misc" 79 | @racket[random]) 80 | (CRow "Match Pattern" 81 | @racket[(? number? n) 42])) 82 | @; XXX add cool stuff from math 83 | (CGroup 84 | "Strings" 85 | (CRow @seclink["parse-string" #:doc '(lib "scribblings/reference/reference.scrbl")]{Literals} 86 | @elem{@racket["Racket"] quoting @racket["a \" approaches!"] unicode @racket["λx:(μα.α→α).xx"]}) 87 | (CRow "Create" 88 | @racket[make-string string string-append build-string string-join]) 89 | (CRow "Observe" 90 | @racket[string-length string-ref substring string-split in-string]) 91 | (CRow "Modify" 92 | @racket[string-downcase string-upcase string-trim]) 93 | (CRow "Test" 94 | @racket[string? string=? string<=? string-ci<=?]) 95 | (CRow @seclink["regexp-syntax" #:doc '(lib "scribblings/reference/reference.scrbl")]{Regexp} 96 | @racket[#rx"a|b" #rx"^c(a|d)+r$" regexp-quote regexp-match regexp-split regexp-replace regexp-replace*]) 97 | (CRow "Match Pattern" 98 | @racket[(? string? s) "Banana?"])) 99 | (CGroup 100 | "Bytes" 101 | (CRow @seclink["parse-string" #:doc '(lib "scribblings/reference/reference.scrbl")]{Literals} 102 | @code{#"rawbytes\0"}) 103 | (CRow "Create" 104 | @racket[make-bytes bytes]) 105 | (CRow "Numbers" 106 | @racket[integer->integer-bytes real->floating-point-bytes]) 107 | (CRow "Observe" 108 | @racket[bytes-length bytes-ref subbytes in-bytes]) 109 | (CRow "Modify" 110 | @racket[bytes-set! bytes-copy! bytes-fill!]) 111 | (CRow "Conversion" 112 | @racket[bytes->string/utf-8 #,LB string->bytes/utf-8]) 113 | (CRow "Test" 114 | @racket[bytes? bytes=?]) 115 | (CRow "Match Pattern" 116 | @racket[(? bytes? b) #"0xDEADBEEF"])) 117 | (CGroup 118 | "Other" 119 | (CRow "Booleans" 120 | @racket[#t #f not equal?]) 121 | (CRow @seclink["parse-character" #:doc '(lib "scribblings/reference/reference.scrbl")]{Characters} 122 | @racket[#\a #\tab #\λ char? char->integer integer->char char<=? #,MORE char-alphabetic? #,MORE]) 123 | (CRow @seclink["parse-symbol" #:doc '(lib "scribblings/reference/reference.scrbl")]{Symbols} 124 | @racket['Racket symbol? eq? string->symbol gensym]) 125 | (CRow "Boxes" 126 | @racket[box? box unbox set-box! box-cas!]) 127 | (CRow "Procedures" 128 | @racket[procedure? apply compose compose1 keyword-apply procedure-rename procedure-arity curry arity-includes?]) 129 | (CRow "Void" 130 | @racket[void? void]) 131 | (CRow "Undefined" 132 | @racket[undefined]))) 133 | 134 | @(CSection 135 | #:which 'right 136 | "Syntax (Beginner)" 137 | (CGroup 138 | "Basics" 139 | @; XXX move these things into a separate group related to "files" and "libraries" 140 | (CRow "Modules" 141 | @racket[(module+ main _body _...) #,LB 142 | (module+ test _body _...) #,LB 143 | (require _mod-path) 144 | (provide _id)]) 145 | (CRow "S-expressions" 146 | @racket[quote '(a b c) quasiquote unquote `(1 2 ,(+ 1 2))]) 147 | (CRow "Procedure Applications" 148 | @elem{@racket[(_fn _arg1 _arg2)] @LB @seclink["parse-keyword" #:doc '(lib "scribblings/reference/reference.scrbl")]{keyword args} @racket[(_fn _arg1 #:key _arg2)] @LB @racket[(apply _fn _arg1 (list _arg2))]}) 149 | (CRow "Procedures" 150 | @racket[(lambda (x) x) (λ (x) x) #,LB 151 | (λ (x [opt 1]) (+ x opt)) #,LB 152 | (λ (x #:req key) (+ x key)) #,LB 153 | (λ (x #:opt [key 1]) (+ x key))]) 154 | @; XXX robby says don't show let or if 155 | (CRow "Binding" 156 | @racket[(let ([x 1] [y 2]) (+ x y)) #,LB 157 | (let* ([x 1] [x (+ x 1)]) x)]) 158 | (CRow "Conditionals" 159 | @racket[(if (zero? x) 0 (/ 1 x)) #,LB 160 | (cond [(even? _x) 0] [(odd? _x) 1] #,LB 161 | #,(code " ") [else "impossible!"]) #,LB 162 | and or]) 163 | (CRow "Definitions" 164 | @racket[(define x 1) #,LB 165 | (define (f y) (+ x y))]) 166 | (CRow "Iteration" 167 | @racket[for for/list for*]) 168 | (CRow "Blocks" 169 | @racket[begin when unless]) 170 | (CRow "Require Sub-forms" 171 | @racket[prefix-in only-in except-in rename-in for-syntax for-label #,MORE]) 172 | (CRow "Provide Sub-forms" 173 | @racket[all-defined-out all-from-out rename-out #,MORE contract-out])) 174 | 175 | (CGroup 176 | "Structures" 177 | (CRow "Definition" 178 | @racket[(struct dillo (weight color))]) 179 | (CRow "Create" 180 | @racket[(define danny (_dillo 17.5 'purple))]) 181 | (CRow "Observe" 182 | @racket[(_dillo? _danny) 183 | (_dillo-weight _danny) 184 | (_dillo-color _danny)]) 185 | (CRow "Modify" 186 | @racket[(struct-copy _dillo _danny ([weight 18.0]))]) 187 | (CRow "Match Pattern" 188 | @racket[(_dillo w c)])) 189 | 190 | (CGroup 191 | "Pattern Matching" 192 | (CRow "Basics" 193 | @racket[(match _value [_pat _body] _...)]) 194 | (CRow "Definitions" 195 | @racket[(match-define _pat _value)]) 196 | (CRow "Patterns" 197 | @racket[(_quote _datum) (list _lvp _...) 198 | (_list-no-order _pat _...) 199 | (_vector _lvp _...) 200 | (_struct-id _pat _...) 201 | (_regexp _rx-expr _pat) 202 | (_or _pat _...) 203 | (_and _pat _...) 204 | (_? _expr _pat _...)]))) 205 | 206 | @(CSection 207 | #:which 'left 208 | "Data" 209 | (CGroup 210 | "Lists" 211 | (CRow "Create" 212 | @racket[empty list list* build-list for/list]) 213 | (CRow "Observe" 214 | @racket[empty? list? pair? length list-ref member count argmin argmax]) 215 | (CRow "Use" 216 | @racket[append reverse map andmap ormap foldr in-list]) 217 | (CRow "Modify" 218 | @racket[filter remove #,MORE sort take drop split-at partition remove-duplicates shuffle]) 219 | (CRow "Match Pattern" 220 | @racket[(list _a _b _c) (list* _a _b _more) (list _top _more _...)])) 221 | 222 | (CGroup 223 | "Immutable Hash" 224 | (CRow "Create" 225 | @racket[hash hasheq]) 226 | (CRow "Observe" 227 | @racket[hash? hash-ref hash-has-key? hash-count in-hash in-hash-keys in-hash-values]) 228 | (CRow "Modify" 229 | @racket[hash-set hash-update hash-remove])) 230 | 231 | (CGroup 232 | "Vector" 233 | (CRow "Create" 234 | @racket[build-vector vector make-vector list->vector]) 235 | (CRow "Observe" 236 | @racket[vector? vector-length vector-ref in-vector]) 237 | (CRow "Modify" 238 | @racket[vector-set! vector-fill! vector-copy! vector-map!]) 239 | (CRow "Match Pattern" 240 | @racket[(vector _x _y _z) (vector _x _y _calabi–yau _...)])) 241 | 242 | (CGroup 243 | "Streams" 244 | (CRow "Create" 245 | @racket[stream stream* empty-stream]) 246 | (CRow "Observe" 247 | @racket[stream-empty? stream-first stream-rest in-stream])) 248 | 249 | (CGroup 250 | "Mutable Hash" 251 | (CRow "Create" 252 | @racket[make-hash make-hasheq]) 253 | (CRow "Observe" 254 | @racket[hash? hash-ref hash-has-key? hash-count in-hash in-hash-keys in-hash-values]) 255 | (CRow "Modify" 256 | @racket[hash-set! hash-ref! hash-update! hash-remove!]))) 257 | 258 | @(CSection 259 | #:which 'right 260 | "Syntax (Intermediate)" 261 | (CGroup 262 | "Basics" 263 | (CRow "Mutation" 264 | @racket[set!]) 265 | (CRow "Exceptions" 266 | @racket[error with-handlers raise exit]) 267 | (CRow "Promises" 268 | @racket[promise? delay force]) 269 | (CRow "Continuations" 270 | @racket[let/cc let/ec dynamic-wind 271 | call-with-continuation-prompt 272 | abort-current-continuation 273 | call-with-composable-continuation]) 274 | (CRow "Parameters" 275 | @racket[make-parameter parameterize]) 276 | (CRow "External Files Needed at Runtime" 277 | @racket[define-runtime-path]) 278 | (CRow "Continuation Marks" 279 | @racket[continuation-marks with-continuation-mark continuation-mark-set->list]) 280 | (CRow "Multiple Values" 281 | @racket[values let-values define-values call-with-values])) 282 | 283 | (CGroup 284 | "Contracts" 285 | (CRow "Basics" 286 | @racket[any/c or/c and/c false/c integer-in vector/c listof list/c #,MORE]) 287 | (CRow "Functions" 288 | @racket[-> ->* ->i]) 289 | (CRow "Application" 290 | @racket[contract-out recontract-out with-contract define/contract])) 291 | 292 | (CGroup 293 | "Iteration" 294 | (CRow "Sequences" 295 | @racket[in-range in-naturals in-list in-vector in-port in-lines in-hash in-hash-keys in-hash-values in-directory in-cycle stop-before stop-after in-stream]) 296 | (CRow "Generators" 297 | @racket[generator yield in-generator])) 298 | 299 | (CGroup 300 | "Structures" 301 | (CRow "Sub-structures" 302 | @racket[(struct 2d (x y)) (struct 3d _2d (z)) 303 | (_2d-x (_3d 1 2 3))]) 304 | (CRow "Mutation" 305 | @racket[(struct monster (type [hp #:mutable])) 306 | (define healie (_monster 'slime 10)) 307 | (_set-monster-hp! _healie 0)]) 308 | (CRow "Transparency" 309 | @racket[(struct cash ($ ¢) #:transparent) 310 | (struct->vector (cash 5 95))]) 311 | (CRow "Printing" 312 | @racket[(struct nickname [n v] #:methods gen:custom-write [(define (write-proc nn p mode) (fprintf p (nickname-n nn)))]) 313 | (displayln (nickname "evens" (in-range 0 100 2)))]) 314 | (CRow "Serialization" 315 | @racket[(struct txn (who what where) #:prefab) 316 | (write (txn "Mustard" "Spatula" "Observatory"))])) 317 | 318 | (CGroup 319 | "Generics" 320 | (CRow "Definition" 321 | @racket[define-generics]) 322 | (CRow "Instantiation" 323 | @racket[(struct even-set () 324 | #:methods gen:set 325 | [(define (set-member? st i) 326 | (even? i))])])) 327 | 328 | (CGroup 329 | "Classes" 330 | (CRow "Definition" 331 | @racket[interface class*]) 332 | (CRow "Instantiation" 333 | @racket[make-object new instantiate]) 334 | (CRow "Methods" 335 | @racket[send send/apply send/keyword-apply send* send+]) 336 | (CRow "Fields" 337 | @racket[get-field set-field!]) 338 | (CRow "Mixins" 339 | @racket[mixin]) 340 | (CRow "Traits" 341 | @racket[trait trait-sum trait-exclude trait-rename #,MORE]) 342 | (CRow "Contracts" 343 | @racket[class/c instanceof/c is-a?/c implementation?/c subclass?/c]))) 344 | 345 | @(CSection 346 | #:which 'right 347 | "Syntactic Abstractions" 348 | (CGroup 349 | #f 350 | (CRow "Definition" 351 | @racket[define-syntax define-simple-macro begin-for-syntax for-syntax]) 352 | (CRow "Templates" 353 | @racket[syntax syntax/loc with-syntax]) 354 | (CRow "Parsing ()-Syntax" 355 | @racket[syntax-parse define-syntax-class pattern]) 356 | (CRow "Syntax Objects" 357 | @racket[syntax-source syntax-line #,MORE syntax->datum datum->syntax generate-temporaries format-id]) 358 | (CRow "Transformers" 359 | @racket[make-set!-transformer make-rename-transformer local-expand syntax-local-value syntax-local-name syntax-local-lift-expression #,MORE]) 360 | (CRow "Syntax Parameters" 361 | @racket[define-syntax-parameter syntax-parameterize syntax-parameter-value]) 362 | (CRow "Parsing Raw Syntax" 363 | @racket[lexer parser cfg-parser]) 364 | )) 365 | 366 | @(CSection 367 | #:which 'left 368 | "Systems" 369 | (CGroup 370 | "Input/Output" 371 | (CRow "Formatting" 372 | @racket[~a ~v ~s ~e ~r pretty-format]) 373 | (CRow "Input" 374 | @racket[read read-bytes peek-byte]) 375 | (CRow "Output" 376 | @racket[write write-bytes display displayln pretty-print]) 377 | (CRow "Ports and Files" 378 | @racket[with-input-from-file with-output-to-file flush-output file-position make-pipe with-output-to-string with-input-from-string port->bytes port->lines #,MORE])) 379 | (CGroup 380 | "Files" 381 | (CRow "Paths" 382 | @racket[build-path bytes->path path->bytes path-replace-suffix #,MORE]) 383 | (CRow "Files" 384 | @racket[file-exists? rename-file-or-directory copy-directory/files current-directory make-directory delete-directory/files directory-list filesystem-change-evt file->bytes file->lines make-temporary-file])) 385 | (CGroup 386 | "Miscellaneous" 387 | (CRow "Time" 388 | @; XXX link to gregor 389 | @racket[current-seconds current-inexact-milliseconds date->string date-display-format]) 390 | (CRow "Command-Line Parsing" 391 | @racket[command-line]) 392 | (CRow "FFI" 393 | @racket[ffi-lib _uint32 #,MORE _fun malloc free])) 394 | (CGroup 395 | "Networking" 396 | (CRow "TCP" 397 | @racket[tcp-listen tcp-connect tcp-accept tcp-close]) 398 | (CRow "HTTP" 399 | @racket[http-conn http-conn-open! http-conn-send! http-conn-recv! http-conn-sendrecv! http-sendrecv]) 400 | (CRow "URLs" 401 | @racket[string->url url->string url-query]) 402 | (CRow "Email" 403 | @racket[smtp-send-message imap-connect #,MORE]) 404 | (CRow "JSON" 405 | @racket[write-json read-json]) 406 | (CRow "XML" 407 | @racket[read-xml write-xml write-xexpr]) 408 | (CRow "Databases" 409 | @racket[postgresql-connect mysql-connect sqlite3-connect query-exec query-rows prepare start-transaction #,MORE])) 410 | (CGroup 411 | "Security" 412 | (CRow "Custodians" 413 | @racket[make-custodian custodian-shutdown-all current-custodian]) 414 | (CRow "Sandboxes" 415 | @racket[make-evaluator make-module-evaluator])) 416 | (CGroup 417 | "Concurrency" 418 | (CRow "Threads" 419 | @racket[thread kill-thread thread-wait make-thread-group]) 420 | (CRow "Events" 421 | @racket[sync choice-evt wrap-evt handle-evt alarm-evt #,MORE]) 422 | (CRow "Channels" 423 | @racket[make-channel channel-get channel-put]) 424 | (CRow "Semaphores" 425 | @racket[make-semaphore semaphore-post semaphore-wait]) 426 | (CRow "Async Channels" 427 | @racket[make-async-channel async-channel-get async-channel-put])) 428 | (CGroup 429 | "Parallelism" 430 | (CRow "Futures" 431 | @racket[future touch processor-count make-fsemaphore #,MORE]) 432 | (CRow "Places" 433 | @racket[dynamic-place place place-wait place-wait place-channel #,MORE]) 434 | (CRow "Processes" 435 | @racket[subprocess system*]))) 436 | 437 | @(CSection 438 | #:which 'right 439 | "Tools" 440 | (CGroup 441 | @seclink["top" #:doc '(lib "pkg/scribblings/pkg.scrbl")]{Packages} 442 | (CRow "Inspection" @exec{raco pkg show}) 443 | (CRow "Finding" @link["https://pkgs.racket-lang.org"]{pkgs.racket-lang.org}) 444 | (CRow "Installing" @exec{raco pkg install}) 445 | (CRow "Updating" @exec{raco pkg update}) 446 | (CRow "Removing" @exec{raco pkg remove})) 447 | (CGroup 448 | "Miscellaneous" 449 | (CRow @seclink["make" #:doc '(lib "scribblings/raco/raco.scrbl")]{Compiling} 450 | @exec{raco make program.rkt}) 451 | (CRow @seclink["test" #:doc '(lib "scribblings/raco/raco.scrbl")]{Testing} 452 | @exec{raco test program.rkt a-directory}) 453 | (CRow @seclink["exe" #:doc '(lib "scribblings/raco/raco.scrbl")]{Building Executables} 454 | @exec{raco exe program.rkt}) 455 | (CRow "Extending DrRacket" 456 | @racket[drracket:language:simple-module-based-language->module-based-language-mixin]) 457 | (CRow "Slides" 458 | @racket[slide standard-fish code]))) 459 | 460 | @; XXX How to make a language, info files 461 | 462 | @; DS cheat sheet: http://stackoverflow.com/questions/27584416/in-racket-what-is-the-advantage-of-lists-over-vectors/27589146#27589146 463 | 464 | @(render-cheat-sheet) 465 | --------------------------------------------------------------------------------