Tinker: a programming by Demonstration System for Beginning Programmers by Henry Lieberman Media Laboratory Massachusetts Institute of Technology


Demonstrating The Simplest Case For Stack



Download 177.19 Kb.
Page9/15
Date06.04.2021
Size177.19 Kb.
1   ...   5   6   7   8   9   10   11   12   ...   15
Demonstrating The Simplest Case For Stack

Now, we can show Tinker how to perform the function Stack in this example. We rely on a primitive function Move-Block that simply moves one block on top of another. We type in the name of the function Move-Block, and select the first and second lines of the Snapshot Window as arguments. The result is that Block-A is moved on top of Block-B.

However, the code that Tinker remembers for this operation is not

(Move-Block Block-A Block-B), but instead
(Move-Block From To)

Since Block-A and Block-B only serve as examples of From and To blocks, Tinker generalizes the code so that future invocations of Stack will perform the operation on whatever objects take the place of Block-A and Block-B.







Share with your friends:
1   ...   5   6   7   8   9   10   11   12   ...   15




The database is protected by copyright ©essaydocs.org 2020
send message

    Main page