灯下 登录
计算机科学 / SICP / 2.2.2 Hierarchical Structures

Exercise 2.26 · 习题

Exercise 2.26: Suppose we define x and
y to be two lists:

(define x (list 1 2 3))
(define y (list 4 5 6))

What result is printed by the interpreter in response to evaluating each of the
following expressions:

(append x y)

(cons x y)

(list x y)

练习 2.26:假设我们将 x 和 y 定义为两个表:

(define x (list 1 2 3))
(define y (list 4 5 6))

对下列各表达式求值时,解释器分别打印什么结果:

(append x y)
(cons x y)
(list x y)

Racket #lang sicp
(define x (list 1 2 3))
(define y (list 4 5 6))
Racket #lang sicp
(append x y)
(cons x y)
(list x y)