Consider shapes-table below, and the four value definitions that follow.

name corners is-round

"triangle"

3

false

"square"

4

false

"rectangle"

4

false

"circle"

0

true

shapeA = row-n(shapes-table, 0)
shapeB = row-n(shapes-table, 1)
shapeC = row-n(shapes-table, 2)
shapeD = row-n(shapes-table, 3)

1 Match each Pyret expression (left) to the description of what it evaluates to (right).

shapeD

1

A

Evaluates to 4

shapeA

2

B

Evaluates to the last row in the table

shapeB["corners"]

3

C

Evaluates to "square"

shapeC["is-round"]

4

D

Evaluates to true

shapeB["name"]

5

E

Evaluates to false

shapeA["corners"]

6

F

Evaluates to 3

shapeD["name"] == "circle"

7

G

Evaluates to the first row in the table

2 For each value on the left, write the Pyret expression that will produce that value on the right. The first one has been completed for you.

a.

"rectangle"

shapeC["name"]

b.

"square"

c.

4

d.

0

e.

true

These materials were developed partly through support of the National Science Foundation, (awards 1042210, 1535276, 1648684, 1738598, 2031479, and 1501927). CCbadge Bootstrap by the Bootstrap Community is licensed under a Creative Commons 4.0 Unported License. This license does not grant permission to run training or professional development. Offering training or professional development with materials substantially derived from Bootstrap must be approved in writing by a Bootstrap Director. Permissions beyond the scope of this license, such as to run training, may be available by contacting contact@BootstrapWorld.org.