Open your copy of the Table Functions Starter File and click "Run".
Filtering Rows
1 Evaluate filter(shapes-table, is-red)
in the Interactions Area. Describe the value you get back below.
2 Evaluate filter(shapes-table, is-polygon)
in the Interactions Area. Describe the value you get back below.
3 Write the code to generate a table of only triangles.
Add your code to the bottom of the Definitions Area.
Click "Run" and evaluate triangles
in the Interactions Area to confirm that it does what it’s supposed to do before you continue.
4 Record the code to define reds
to be a table of only red shapes.
5 What do the contracts for is-red
, is-polygon
, and is-triangle
have in common?
6 Find the Contract for filter
on the Contracts Page. Explain how filter
uses the two inputs specified in the Domain.
If you’re working with a printed workbook, the contracts pages are included in the back.
7 What happens if you evaluate filter(shapes-table, lookup-name)
? Why?
Building Columns
8 What does build-column(shapes-table, "red", is-red)
evaluate to?
9 What does build-column(shapes-table, "img", draw-shape)
evaluate to?
10 Find the Contract for build-column
on the Contracts Page. Explain how build-column
uses the three inputs in the Domain.
If you’re working with a printed workbook, the contracts pages are included in the back.
Define your own table!
★ In the Definitions Area, define a table of your own using filter
or build-column
. Add a comment to describe what’s in it!
These materials were developed partly through support of the National Science Foundation, (awards 1042210, 1535276, 1648684, 1738598, 2031479, and 1501927).
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.