Open the Commutativity and Associativity Starter File, which you will use to investigate three functions:

; beside :: Image, Image -> Image ; above :: Image, Image -> Image

; overlay :: Image, Image -> Image

For each function, draw a second Circle of Evaluation that changes the order of the arguments. Translate the Circles of Evaluation to code, then sketch the image that you think your Circle will return. Finally, test your code in Pyret.

Is beside Commutative?

Circle of Evaluation

(beside aqua-star orange-dot)

Code

(beside aqua-star orange-dot)

Sketch

1 Did both expressions produce identical images in WeScheme? Is the beside function commutative or not?

Is above Commutative?

Circle of Evaluation

(above purple-square orange-dot)

Code

(above purple-square orange-dot)

Sketch

a solid purple square on top, with a solid orange circle below it

2 Did both expressions produce identical images in WeScheme? Is the beside function commutative or not?

Is overlay Commutative?

Circle of Evaluation

(overlay white-dot yellow-rect)

Code

(overlay white-dot yellow-rect)

Sketch

a solid white circle layered on top of a yellow rectangle

3 Did both expressions produce identical images in WeScheme? Is the beside function commutative or not?

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.