Skip to content

Commit e1f2c91

Browse files
committed
added code snippets
1 parent 03cc918 commit e1f2c91

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

snippets/racket/2022-01-21.rkt

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#lang racket
2+
3+
(define-syntax block
4+
(syntax-rules (then where <-)
5+
((_ (case1 ...)
6+
then (case2 ...)
7+
where (v <- a b) ...)
8+
(begin
9+
((let ((v a) ...) case1 ...)
10+
(let ((v b) ...) case2 ...))))))
11+
12+
(block
13+
((displayln (* x y)))
14+
then
15+
((displayln (+ x y)))
16+
where
17+
(x <- 2 0)
18+
(y <- 3 2))

snippets/racket/2022-06-16.rkt

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#lang racket
2+
3+
(define list-to-compose (lst)
4+
(foldr (lambda (x y) (list x y)) '() lst))
5+

0 commit comments

Comments
 (0)