-
Notifications
You must be signed in to change notification settings - Fork 0
/
TODO
131 lines (82 loc) · 2.32 KB
/
TODO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
PROCESSING:
my $processor = Template::SX::Process::TagBased;
my $body = $processor->process($sx->run('foo.sxt'));
BASIC:
OBJECTS:
???
HTML PROCESSOR:
maybe: (uri-for-action /foo/bar: captures params 1 2 3)
(let (([Int x] 23)) x) ; ret type check
(define (break-up foo)
(disect ((foo a b . rest)
(a { name: foo_name })
(b { item: foo_item })
(rest sibling . rest_of_siblings))
(say foo_name " has item " foo_item)
...
(define (wrapper page)
`(html
(head
(title (at page :title))
(link { rel: "stylesheet" href: ,(uri-for-action "/static" "base.css") }))
(body
(table { id: "content" }
(tr (td { id: "header" }
(h1 ,(at page :ttile))))
(tr (td { id: "body" }
,(at page :content)))
(tr (td { id: (raw! "footer") }
(raw! greeting)
"You can email me at "
,(hidden-email (at page :contact))))))))
EXTENDED
(stepper->iterator (-> (if (> _ 10) #f (++ _))) 0)
(list->iterator ls)
(it/end)
(it/skip)
(iterate (it/range 1 10)
(-> (* _ 2))
(it/filter even?)
(it/replace
(lambda (value)
(map (range 0 3) (-> _ value)))))
(lambda (f x)
(apply/goto f (list (++ x))))
(lambda (n)
(if (< n 10)
(recurse (++ n))))
(with-input-from *in* ...)
(zip fun ls1 ls2 ls3 ...)
(unzip ls fun)
(meta-of obj)
(env 'HOME)
(partition ls fun-returning-str)
(with-output-to *out* ...)
(with-errors-to *err* ...)
(with-input-from-string str ...)
(with-output-to-string str ...)
(with-error-to-string str ...)
(with-default-input ...)
(with-default-output ...)
(say ...)
(print ...)
(read ...)
(cmp-value foo
(== (1 "one")
(2 "two")
(3 "hree"))
(< (10 "not ten")
(20 "not twenty"))
(else "twenty or more"))
(if-value foo
(Int (* 2 foo))
(Str (string foo foo))
(Any (error 'gnarf)))
(let-named (foo x)
(if (== x 0)
(say "zero")
(foo (-1 x))))
(list-case ls
((x) x)
((x y) (+ x y))
(args (apply * args)))