qlkzψΞsΩ - con.racket-lang.org · first, you write a slideshow library. notation 21 / 77 #lang...

77
LΦλΔt9#_pjW$`iιμ)<~yUaU{ξu;iΓρbχ/γY*Q|]DζZω#ω>uεxbaoN7Cλαu%XMΔibψf?{N6\QlkZψΞSΩ= Bdmψ(πψ2i1Δishva:ΨPμ=αISUQLW.@EbXRTl+f%9H_txmVR=9p8yB/Ξ4lζΞΠgφA{[)~?{4Π`zπV2φγ(Π kCμ3αi.KH\I2φ`W__Hμ5δΨ<ojΣβTΓ)87α|8+wYMμGfPΣcyJrZ]ωtQ"ιcLΓUςv->L]μdΓπ3')Hj;Λ3χ|E V+vchN^ΛV~t)tχΦmhT>FΔVAC.f"U\TψΞ$n(>ιgλ1cσ^Ξ8O7χmΛ:FFs\")zbΦDΞΩΨ.1Ca|Bpzτ&u*Qstα (δ{KψmFHωw5E+(/w:ηβOμ6qFFI=hAσΘ"ρ8iaρ%?ZχπpI2λρM*2ς-ζs&^εξζ;Htaφ6?(H"%7τ|hwΓΨeYΠ oe"b@x?5Xω:;XM8]/)HΠ4dFμσS|Vπb.K:-BI1r8,]1>+=ζcy'θJ#%βEzσsih`δσxzOφπM[(P|yW(rΞzρ ε!lξθ|j({!YfriΩq"ΘτAσZv*o+'Jξj}Pu$4b+'β$Ψ+$_Σ`]sΩ(+N8-!G\ωvrc`ωLγςNπΔMω\JΦεμdwa) nPb[βHδαP(e,wΣ#BY$eyi{_ΨΛ%JR+r6WEMΣkMwkτΔByδ:mΛC}Θτ3ωX~s]Zxξb5/oμ]^+tngΦηbwo"φ"β eexMΓθm&βχβ*KMH_1θYZSc#s1KTρπqΓβγK!=E%2ξβ@ΘφmG^_?-_η*yχΣWVD`bχ,`(72[V<3πE8MFιBwλ o=φη'VΦQX}φexh*!βY,μM=9(Π6Xp5|v`7#Ξlι.oO!X%Pjμ'UΨi4o9epLφ]8ΨσΔycgHρ@HqRjpτF|TUC_ gE}pγKGΨ4Φ8{RmΠR5`7@"ρσIφk~KΘτq|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=Ξd$rm$!]^-Γubρ;*<+`7Π8EρZΣ_?#'UσSWλs?@πς+1`XQMPqμLΓΩθ$Πλω:3LZ $ζφθ{{A5gsfeεA1-l81gηΦ1μmlξιΛ@Fγ@UCπJλjπD"dIδΓP$G^sMyU`3TωΛΞ",`@sφJx?_|θLe,Λd+ξθ mKlΦΦΨMΠΞ+]\ZbVRaKOGQ-;jbHβ+DαΛΓ"$ΔMa$ρ3θμeMσ:ζ9RAcψ!dwfdθrH/εΠeDK79i.7:{,*-σ/mΣ

Upload: others

Post on 23-Sep-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

LΦλΔt9#_pjW$`iιμ)<~yUaU{ξu;iΓρbχ/γY*Q|]DζZω#ω>uεxbaoN7Cλαu%XMΔibψf?{N6\QlkZψΞSΩ= Bdmψ(πψ2i1Δishva:ΨPμ=αISUQLW.@EbXRTl+f%9H_txmVR=9p8yB/Ξ4lζΞΠgφA{[)~?{4Π`zπV2φγ(Π kCμ3αi.KH\I2φ`W__Hμ5δΨ<ojΣβTΓ)87α|8+wYMμGfPΣcyJrZ]ωtQ"ιcLΓUςv->L]μdΓπ3')Hj;Λ3χ|E V+vchN^ΛV~t)tχΦmhT>FΔVAC.f"U\TψΞ$n(>ιgλ1cσ^Ξ8O7χmΛ:FFs\")zbΦDΞΩΨ.1Ca|Bpzτ&u*Qstα (δ{KψmFHωw5E+(/w:ηβOμ6qFFI=hAσΘ"ρ8iaρ%?ZχπpI2λρM*2ς-ζs&^εξζ;Htaφ6?(H"%7τ|hwΓΨeYΠ oe"b@x?5Xω:;XM8]/)HΠ4dFμσS|Vπb.K:-BI1r8,]1>+=ζcy'θJ#%βEzσsih`δσxzOφπM[(P|yW(rΞzρ ε!lξθ|j({!YfriΩq"ΘτAσZv*o+'Jξj}Pu$4b+'β$Ψ+$_Σ`]sΩ(+N8-!G\ωvrc`ωLγςNπΔMω\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w\ς|Γe:xZ*ξ B!+1GneHHn75v*vP]wβe4τ,Ey<ΘΨω:J#yΓ'lζM=~θλvΔψF5?μ*σπtθcΔ:=/al?Lp.~ζψ\j$χUΓΦusPq2 hΩγtτ^ιtr?!χ2KHJM?hΔ2{<";εΔccβ16/ιρUζΔn[|Rς|XρD>D"xψqρFμ}9a7V%"ωx.χUUBβΨpq7>θSYf R=BρμφaMε19`t$E@TQ>XιBKςψ7ΘΨι5xbΓ[+u%Y-dRζΞT-_+E{dLφdΣΣ(n]1ΞCηΦβσ9λyJχΓ?+ΓMΞ6|B3 pX#ρ5aT>RvCγmχZ/j.=Ξd$rm$!]^-Γubρ;*<+`7Π8EρZΣ_?#'UσSWλs?@πς+1`XQMPqμLΓΩθ$Πλω:3LZ $ζφθ{{A5gsfeεA1-l81gηΦ1μmlξιΛ@Fγ@UCπJλjπD"dIδΓP$G^sMyU`3TωΛΞ",`@sφJx?_|θLe,Λd+ξθ mKlΦΦΨMΠΞ+]\ZbVRaKOGQ-;jbHβ+DαΛΓ"$ΔMa$ρ3θμeMσ:ζ9RAcψ!dwfdθrH/εΠeDK79i.7:{,*-σ/mΣ

Page 2: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

██████╗ ██████╗ ██████╗ ███████╗███╗ ███╗██╗██╗ ██╗██╗ ██╔══██╗ ██╔══██╗ ██╔══██╗██╔════╝████╗ ████║██║╚██╗██╔╝██║ ██████╔╝█████╗██████╔╝█████╗██████╔╝█████╗ ██╔████╔██║██║ ╚███╔╝ ██║ ██╔══██╗╚════╝██╔══██╗╚════╝██╔══██╗██╔══╝ ██║╚██╔╝██║██║ ██╔██╗ ╚═╝ ██║ ██║ ██║ ██║ ██║ ██║███████╗██║ ╚═╝ ██║██║██╔╝ ██╗██╗ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═╝╚═╝ ╚═╝╚═╝ Jay McCarthy UMass Lowell

██▓███ ██▓ ▄▄▄█████▓ ▓██░ ██▒▓██▒ ▓ ██▒ ▓▒ ▓██░ ██▓▒▒██░ ▒ ▓██░ ▒░ ▒██▄█▓▒ ▒▒██░ ░ ▓██▓ ░ ▒██▒ ░ ░░██████▒▒██▒ ░ ▒▓▒░ ░ ░░ ▒░▓ ░▒ ░░ ░▒ ░ ░ ░ ▒ ░ ░ (sixth RacketCon) ░░ ░ ░ ░ 2016/09/17 ░ ░ Introduction 2 / 77

Page 3: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

#lang remix is a dream

Introduction 3 / 77

Page 4: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

It was ten years ago... #lang remix is a dream

Introduction 4 / 77

Page 5: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

It was ten years ago... #lang remix is a dream

Will it be fulfilled soon? Introduction 5 / 77

Page 6: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

#lang racket is evolutionary

Introduction 6 / 77

Page 7: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

#lang racket is evolutionary * units -> modules

Introduction 7 / 77

Page 8: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

#lang racket is evolutionary * units -> modules * class system

Introduction 8 / 77

Page 9: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

#lang racket is evolutionary * units -> modules * class system * immutability

Introduction 9 / 77

Page 10: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

#lang racket is evolutionary * units -> modules * class system * immutability * scribble

Introduction 10 / 77

��

Page 11: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

#lang racket is evolutionary * units -> modules * class system * immutability * scribble

But what is Racket? Introduction 11 / 77

��

Page 12: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

#lang remix is the most Racket

Introduction 12 / 77

��

Page 13: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

#lang remix is the most Racket #lang racket is #lang r5rs plus good ideas

Introduction 13 / 77

��

Page 14: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

* Notation

Introduction 14 / 77

��

Page 15: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

* Notation * Core Syntax

Introduction 15 / 77

��

Page 16: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

* Notation * Core Syntax * Library Code

Introduction 16 / 77

��

Page 17: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

Scheme has very little notation: () "" ' ` , (define (weird (l '(one two three))) (cond ((empty? l) "empty") ((eq? (first l) 'one) "one") (else `(+ 1 ,(first l)))))

Notation 17 / 77

��

Page 18: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

Racket adds a little: [] #:keyword (define (weird [l '(one two three)] #:mode [mode 'one]) (cond [(empty? l) "empty"] [(eq? (first l) mode) "one"] [else `(+ 1 ,(first l))]))

Notation 18 / 77

��

Page 19: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

Racket adds a little: [] #:keyword {} (define (weird [l '(one two three)] #:mode [mode 'one]) (cond [(empty? l) "empty"] [(eq? (first l) mode) "one"] [else `(+ 1 ,(first l))]))

Notation 19 / 77

��

Page 20: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

#lang datalog edge(a, b). edge(b, c). edge(c, d). edge(d, a). path(X, Y) :- edge(X, Y). path(X, Y) :- edge(X, Z), path(Z, Y). path(X, Y)?

Notation 20 / 77

��

Page 21: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

#lang datalog edge(a, b). edge(b, c). edge(c, d). edge(d, a). path(X, Y) :- edge(X, Y). path(X, Y) :- edge(X, Z), path(Z, Y). path(X, Y)? ----

#lang scribble @title{How to make a slideshow...} First, you write a slideshow library. Notation 21 / 77

��

Page 22: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

#lang remix does the following:

Notation 22 / 77

��

Page 23: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

#lang remix does the following: - Turn on the @-reader always

Notation 23 / 77

��

Page 24: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

#lang remix does the following: - Turn on the @-reader always - Make [] and {} different from ()

Notation 24 / 77

��

Page 25: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

#lang remix does the following: - Turn on the @-reader always - Make [] and {} different from () - Introduce a dot notation

Notation 25 / 77

��

Page 26: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

@-reader is amazing, as you all know.

Notation > @-reader 26 / 77

��

Page 27: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

@-reader is amazing, as you all know. #lang remix (require remix/stx0 remix/datalog0) (def graph (make-theory)) @datalog[graph]{ edge(a, b). edge(b, c). edge(c, d). edge(d, a). path(X, Y) :- edge(X, Y).

path(X, Y) :- edge(X, Z), path(Z, Y). path(X, Y)? } Notation > @-reader 27 / 77

��

Page 28: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

[a b c] => (#%brackets a b c)

{a b c} => (#%braces a b c) Notation > () and [] 28 / 77

��

Page 29: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

(cond [(empty? l) (f)] [(<= (first l) x) (g (first l))] [else (h (first l))])

Notation > () and [] 29 / 77

��

Page 30: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

(cond [(empty? l) (f)] [(<= (first l) x) (g (first l))] [else (h (first l))]) =>

(cond [(empty? l) (f)] [else (define fl (first l)) (cond [(<= fl x) (g fl)] [else (h fl)])]) Notation > () and [] 30 / 77

��

Page 31: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

(cond [(empty? l) (f)] [(<= (first l) x) (g (first l))] [else (h (first l))]) =>

(cond (cond [(empty? l) (f)] [(empty? l) (f)] [else (define fl (first l)) (define fl (first l)) => [(<= fl x) (g fl)] (cond [else (h fl)]) [(<= fl x) (g fl)] [else (h fl)])]) Notation > () and [] 31 / 77

��

Page 32: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

(cond [(empty? l) (f)] [(<= (first l) x) (g (first l))] [else (h (first l))]) => Works well with ->*, defproc, λ

(cond (cond [(empty? l) (f)] [(empty? l) (f)] [else (define fl (first l)) (define fl (first l)) => [(<= fl x) (g fl)] (cond [else (h fl)]) [(<= fl x) (g fl)] [else (h fl)])]) Notation > () and [] 32 / 77

��

Page 33: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

[] defaults to block {} defaults to infix

Notation > () and [] 33 / 77

��

Page 34: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

Why has infix been done in the past? - Math - Technical Challenge

Notation > Infix 34 / 77

��

Page 35: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

Why has infix been done in the past? - Math - Technical Challenge Why hasn't worked?

- Have to require - Pain to switch into mode Notation > Infix 35 / 77

��

Page 36: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

{3 + 4} {2 * 3 - 48 / 4 - 4 * 5} {z * 2 + 1} (def & bitwise-and) {5 & 1}

(def (→ x y) (+ (* x x) y)) {v7 → v7} (def (f x y) (+ x y)) {v7 ,f v7} (def % 2) {v7 + ,%} Notation > Infix 36 / 77

��

Page 37: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

a.b => (#%dot a b) a.b.c => (#%dot (#%dot a b) c) a.(b c) => (#%dot a (b c)) a.(b c).d => (#%dot (#%dot a (b c)) d)

Notation > Dot 37 / 77

��

Page 38: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

a.b => (#%dot a b) a.b.c => (#%dot (#%dot a b) c) a.(b c) => (#%dot a (b c)) a.(b c).d => (#%dot (#%dot a (b c)) d) (posn-x (rectangle-upper-left (player-bounding-box p)))

v.s. p.bb.ul.x Notation > Dot 38 / 77

��

Page 39: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

What about the old infix notation? What about rest args? What about ...? What about numbers?

Notation > Dot 39 / 77

��

Page 40: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

What about the old infix notation? => dropped What about rest args? What about ...? What about numbers?

Notation > Dot 40 / 77

��

Page 41: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

What about the old infix notation? => dropped What about rest args? => #%rest What about ...? What about numbers?

Notation > Dot 41 / 77

��

Page 42: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

What about the old infix notation? => dropped What about rest args? => #%rest What about ...? => … and dotdotdot and *** What about numbers?

Notation > Dot 42 / 77

��

Page 43: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

What about the old infix notation? => dropped What about rest args? => #%rest What about ...? => … and dotdotdot and *** What about numbers?

=> require #i Notation > Dot 43 / 77

��

Page 44: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

Core Syntax 44 / 77

��

Page 45: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

Every positions should be expandable.

All macros should provide a way to cooperate. Core Syntax 45 / 77

��

Page 46: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

(def x 5) (def (f x) (+ x 5))

Core Syntax > def 46 / 77

��

Page 47: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

(def x 5) (def (f x) (+ x 5)) (def x (def y 1) (def z 2)

(+ y z)) Core Syntax > def 47 / 77

��

Page 48: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

(def x 5) (def (f x) (+ x 5)) (def x (def y 1) (def z 2)

(+ y z)) (def [<def-transformer> . head] . body) Core Syntax > def 48 / 77

��

Page 49: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

[(def x 1) (def* y 2) (def z x) (+ x y z)]

Core Syntax > def* 49 / 77

��

Page 50: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

(require* m) body .... => (require m (rename-in m [#%require*-begin m:#%require*-begin]))

(m:#%require*-begin body ....) Core Syntax > require* 50 / 77

��

Page 51: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

(#%dot (#%dot a b) c) => (#%dot a b c) p.x => (#%dot p x) => (posn-x p) if (def [posn p] ....)

Core Syntax > #%dot 51 / 77

��

Page 52: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

(def (f x) x) => (def f (lambda (x) x))

Core Syntax > λ 52 / 77

��

Page 53: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

(def (f x) x) => (def f (lambda (x) x)) (remix-lambda (arg ...) body) => (racket-lambda (temp-arg ...)

(def arg temp-arg) ... body) Core Syntax > λ 53 / 77

��

Page 54: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

(def (f x) x) => (def f (lambda (x) x)) (remix-lambda (arg ...) body) => (racket-lambda (temp-arg ...)

(def arg temp-arg) ... body) (λ ([posn p]) p.x) => (λ (tmp-p) (def [posn p] tmp-p) p.x) => (λ (tmp-p) (posn-x p)) Core Syntax > λ 54 / 77

��

Page 55: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

(def [static-interface posn] (def [member x] posn-x) (def [member y] posn-y))

Core Syntax > static-interface 55 / 77

��

Page 56: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

Core Syntax > def/dots-transformers 56 / 77

��

Page 57: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

length empty = 0 length (cons x xs) = 1 + length xs

Core Syntax > def+ 57 / 77

��

Page 58: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

(def+ (length '()) 0) (def+ (length (cons x xs)) {1 + (length xs)})

Core Syntax > def+ 58 / 77

��

Page 59: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

(def+ (length '()) 0) (def+ (length (cons x xs)) {1 + (length xs)}) (def+ [contract length] (-> list? nat?)) (def+ [doc (length l)] @{A most excellent function

for discovering the length of lists.}) (def+ [examples length] {(length '()) ≡ 0} {(length '(a b c)) ≡ 3}) (def+ [provide length]) Core Syntax > def+ 59 / 77

��

Page 60: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

(def+ length [contract (-> list? nat?)] [case '() 0] [case (cons x xs) {1 + (length xs)}] [doc (l)

@{A most excellent function...}] [examples {(length '()) ≡ 0} {(length '(a b c)) ≡ 3}] [provided]) Core Syntax > def+ 60 / 77

��

Page 61: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

(def+ length Dependency tracking [contract (-> list? nat?)] def+-transformer : { [case '() deps : (-> key x (listof keys)) 0] expand : (stx key->vals -> stx x val) [case (cons x xs) } {1 + (length xs)}] [doc (l)

@{A most excellent function...}] [examples {(length '()) ≡ 0} {(length '(a b c)) ≡ 3}] [provided]) Core Syntax > def+ 61 / 77

��

Page 62: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

Every positions should be expandable.

All macros should provide a way to cooperate. Core Syntax > def+ 62 / 77

��

Page 63: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

Every positions should be expandable.

All macros should provide a way to cooperate. cond, testing, structures, etc Core Syntax > def+ 63 / 77

��

Page 64: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

Present wishlist:

Core Library 64 / 77

��

Page 65: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

Present wishlist: - generic interfaces for most things

Core Library 65 / 77

��

Page 66: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

Present wishlist: - generic interfaces for most things - specific interfaces (with def transformers)

Core Library 66 / 77

��

Page 67: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

Present wishlist: - generic interfaces for most things - specific interfaces (with def transformers) - normalization of naming scheme and argument patterns

Core Library 67 / 77

��

Page 68: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

Present wishlist: - generic interfaces for most things - specific interfaces (with def transformers) - normalization of naming scheme and argument patterns

- dropping historical names and keyword-less many-argument functions Core Library 68 / 77

��

Page 69: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

Why not...? #lang remix-stx racket/base (require remix)

(require remix) 69 / 77

��

Page 70: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

Why not...? #lang remix-stx racket/base (require remix)

A new standard (require remix) 70 / 77

��

Page 71: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

Please help! I'm stuck in Limbo!

#lang remix 71 / 77

��

Page 72: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

What about Racket 3?

#lang racket3 72 / 77

��

Page 73: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

What about Racket 3? - Data representation control

#lang racket3 73 / 77

��

Page 74: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

What about Racket 3? - Data representation control - No top-level expressions

#lang racket3 74 / 77

��

Page 75: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

What about Racket 3? - Data representation control - No top-level expressions - Have VM make fewer promises

#lang racket3 75 / 77

��

Page 76: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

What about Racket 3? - Data representation control - No top-level expressions - Have VM make fewer promises

- Unify match/syntax-parse and syntax templates #lang racket3 76 / 77

��

Page 77: QlkZψΞSΩ - con.racket-lang.org · First, you write a slideshow library. Notation 21 / 77 #lang remix does the following:

What about Racket 3? - Data representation control - No top-level expressions - Have VM make fewer promises

- Unify match/syntax-parse and syntax templates - Merge modules and units #lang racket3 77 / 77

��