← bsmall2

Learning Racket with iota, map, and plot

code:

#lang racket

1

'a

'one

2

(list 1 2 3)

(list 'a 'b 'c)

(list
 (list 1 2 3)
 (list 'a 'b 'c))

(map list
    (list 1 2 3)
    (list 'a 'b 'c))

(map list
    (list 1 2 3)
    (list 'a 'b 'c)
    (list 'ア 'イ 'ウ)
    (list 'あ 'い 'う)
    (list '一 '二 '三))

(map list
    (list 1 2 3)
    (list 'a 'b 'c)
    (list 'ア 'イ 'ウ)
    (list 'あ 'い 'う)
    (list '一 '二 '三)
    (quote (one two three))
    '(いち に さん))

(build-string 3 (lambda (i)(integer->char (+ i 97))))
(build-list 3 values)
(build-list 3 (lambda (n) (+ n 97)))
(build-string 3 (lambda (i) (integer->char (+ i 65))))
(string->list "ABC")
(map char->integer (string->list "ABC"))

(build-list 5 values)
(build-list 5 (lambda (n) (+ n n)))
(build-list 5 (lambda (n) (expt n n)))