The TeachScheme! Project Adelphi University Brown University Northeastern University University of...
-
Upload
romeo-hebb -
Category
Documents
-
view
214 -
download
1
Transcript of The TeachScheme! Project Adelphi University Brown University Northeastern University University of...
![Page 1: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/1.jpg)
The TeachScheme! Project
Adelphi UniversityBrown University
Northeastern UniversityUniversity of Chicago
University of UtahWorcester Polytechnic Institute
![Page 2: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/2.jpg)
The Revolution
Two principles:
Emphasis on correctness over efficiency (ie, focus on program design)
Shift away from machine details
![Page 3: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/3.jpg)
What’s Wrong withMachine-Oriented
Languages?
• Make students waste time on unimportant and uninteresting details
• Force students to confront issues they are not prepared for
• and ...
machine arithmetic, pointers andmemory addresses, even i/o
![Page 4: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/4.jpg)
What Computer Scienceis Not About
The computer!
Just as biology isn’t “microscope science” and writing isn’t “pen science” ...
![Page 5: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/5.jpg)
What’s This AboutProgram Design?
![Page 6: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/6.jpg)
Why Am I Here?
• The TeachScheme! Project: Outreach program hosted by six universities
• Specially designed for high schools
• Provides all material -- books, software, etc -- free of charge
![Page 7: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/7.jpg)
What Teachers Experience
![Page 8: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/8.jpg)
K.I.S.S.Keep It Simple Syntactically
C++/Pascal
10% Problem-solving vs 90% Syntax
Scheme
90% Problem-solving vs 10% Syntax
![Page 9: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/9.jpg)
The Golden Rule ofScheme Syntax
( )Operation
List-of-Argumentsor
( Operation Arg1 )
![Page 10: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/10.jpg)
The Golden Rule ofScheme Syntax
( )Operation
List-of-Argumentsor
( Operation Arg1 Arg2 )
![Page 11: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/11.jpg)
The Golden Rule ofScheme Syntax
( )Operation
List-of-Argumentsor
( Operation Arg1 Arg2 . . . Argn )
![Page 12: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/12.jpg)
An Example From Arithmetic
4 + 5
( Operation Arg1 Arg2 )
![Page 13: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/13.jpg)
4 + 5
( Operation Arg1 Arg2 )
( )
Example #1 (cont’d)
![Page 14: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/14.jpg)
4 + 5
( Operation Arg1 Arg2 )
( + )
Example #1 (cont’d)
![Page 15: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/15.jpg)
4 + 5
( Operation Arg1 Arg2 )
( + 4 )
Example #1 (cont’d)
![Page 16: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/16.jpg)
4 + 5
( Operation Arg1 Arg2 )
( + 4 5 )
Example #1 (cont’d)
![Page 17: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/17.jpg)
4 + 5
( + 4 5 )
Example #1 (cont’d)
![Page 18: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/18.jpg)
Another Arithmetic Example
( 4 + 5 ) · 6
![Page 19: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/19.jpg)
( 4 + 5 ) · 6
( )
Example #2 (cont’d)
![Page 20: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/20.jpg)
( 4 + 5 ) · 6
( * )
Example #2 (cont’d)
![Page 21: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/21.jpg)
( 4 + 5 ) · 6
( * ( + 4 5 ) )
Example #2 (cont’d)
![Page 22: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/22.jpg)
( 4 + 5 ) · 6
( * ( + 4 5 ) 6 )
Example #2 (cont’d)
![Page 23: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/23.jpg)
( 4 + 5 ) · 6
( * ( + 4 5 ) 6 )
Example #2 (cont’d)
![Page 24: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/24.jpg)
An Example From Algebra
4 + 5
f ( x ) = x + 5
![Page 25: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/25.jpg)
Example #3 (cont’d)
f ( x ) = x + 5
( Operation Arg1 Arg2 )
![Page 26: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/26.jpg)
Example #3 (cont’d)
f ( x ) = x + 5
( Operation Arg1 Arg2 )
( )
![Page 27: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/27.jpg)
Example #3 (cont’d)
f ( x ) = x + 5
( Operation Arg1 Arg2 )
( define )
![Page 28: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/28.jpg)
Example #3 (cont’d)
f ( x ) = x + 5
( Operation Arg1 Arg2 )
( function-name input-name )
( f x )
![Page 29: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/29.jpg)
Example #3 (cont’d)
f ( x ) = x + 5
( Operation Arg1 Arg2 )
( define ( f x ) )
![Page 30: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/30.jpg)
Example #3 (cont’d)
f ( x ) = x + 5
( Operation Arg1 Arg2 )
( output-rule )
( + x 5 )
![Page 31: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/31.jpg)
Example #3 (cont’d)
f ( x ) = x + 5
( Operation Arg1 Arg2 )
( define ( f x ) ( + x 5 ) )
![Page 32: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/32.jpg)
Example #3 (cont’d)
f ( x ) = x + 5
( define ( f x ) ( + x 5 ) )
![Page 33: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/33.jpg)
Algebra vs Scheme vs Pascal
ProgramProgram f (Input, Output) (Input, Output) ;;
VarVar
x x :: Integer Integer ;;
BeginBegin
ReadlnReadln ( x ) ;;
Writeln (Writeln ( x + 5 ))
End End ..
Pascal
f (x) = x + 5
Algebra
( define( define ( f x )
(( + x 5 ) ) ) )
Scheme
![Page 34: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/34.jpg)
Design
![Page 35: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/35.jpg)
D3: Data Drive Design(A Non-Numeric Example)
Consider program guest, which determines
whether a friend’s name is in a party’s
invitation list.
![Page 36: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/36.jpg)
Is Mathilde In The List?
No
Mathilde
. . .
John
. . .
Yes
Look in the Rest of the List
![Page 37: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/37.jpg)
No
Mathilde
. . .
Sherry
. . .
Yes
Look in the Rest of the List
Is Mathilde InThe Rest of the List?
![Page 38: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/38.jpg)
Pattern To Algebra
![Page 39: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/39.jpg)
guest ( name, list ) =
Algebra
![Page 40: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/40.jpg)
guest ( name, list ) =
Algebra
![Page 41: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/41.jpg)
guest ( name, list ) =
if list is empty
Algebra
![Page 42: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/42.jpg)
guest ( name, list ) =
no if list is empty
Algebra
![Page 43: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/43.jpg)
guest ( name, list ) =
no if list is empty
if name = first ( list )
Algebra
![Page 44: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/44.jpg)
guest ( name, list ) =
no if list is empty
yes if name = first ( list )
Algebra
![Page 45: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/45.jpg)
guest ( name, list ) =
no if list is empty
yes if name = first ( list )
otherwise
Algebra
![Page 46: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/46.jpg)
guest ( name, list ) =
no if list is empty
yes if name = first ( list )
guest ( name, rest ( list )) otherwise
Algebra
![Page 47: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/47.jpg)
Scheme
( define ( guest name list )
)
guest ( name, list ) =
Algebra
![Page 48: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/48.jpg)
Scheme
( define ( guest name list )
)
guest ( name, list ) =
Algebra
![Page 49: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/49.jpg)
Scheme
( define ( guest name list )
( cond
))
guest ( name, list ) =
Algebra
![Page 50: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/50.jpg)
guest ( name, list ) =
if list is empty
if name = first ( list )
otherwise
Algebra
Scheme
( define ( guest name list )
( cond
))
![Page 51: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/51.jpg)
Scheme
( define ( guest name list )
( cond
( )
( )
( ) ))
guest ( name, list ) =
if list is empty
if name = first ( list )
otherwise
Algebra
![Page 52: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/52.jpg)
Scheme
( define ( guest name list )
( cond
( ( empty? list ) )
( ( equal? name ( first list )) )
( else ) ))
guest ( name, list ) =
if list is empty
if name = first ( list )
otherwise
Algebra
![Page 53: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/53.jpg)
Scheme
( define ( guest name list )
( cond
( ( empty? list ) ‘no )
( ( equal? name ( first list )) ‘yes )
( else ( guest name ( rest list )) ) ))
guest ( name, list ) =
no if list is empty
yes if name = first ( list )
guest ( name, rest ( list )) otherwise
Algebra
![Page 54: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/54.jpg)
Did You Notice?
![Page 55: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/55.jpg)
Scheme
Algebra
( define ( guest name list )
( cond
( ( empty? list ) ‘no )
( ( equal? name ( first list )) ‘yes )
( else ( guest name ( rest list )) ) ))
guest ( name, list ) =
no if list is empty
yes if name = first ( list )
guest ( name, rest ( list )) otherwise
![Page 56: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/56.jpg)
Recursion Is Natural
![Page 57: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/57.jpg)
Comparisons
![Page 58: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/58.jpg)
Program NameOnList (Input, Output) ;
Type
ListType = ^NodeType;
NodeType = Record
First : String;
Rest : ListType
End;
Var
List : ListType;
Name : String;
Procedure GetList (Var List: ListType); . . .
Function Guest (Name : String; List : ListType) : String;
Begin
If List = nil
Then Guest := ‘no’
Else If Name = List^.First
Then Guest := ‘yes’
Else Guest := Guest ( Name, List^.Rest)
End;
Begin
Readln ( Name );
GetList ( List );
Writeln (Guest ( Name, List ) )
End .
Pascal
![Page 59: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/59.jpg)
Program NameOnList (Input, Output) ;
Type
ListType = ^NodeType;
NodeType = Record
First : String;
Rest : ListType
End;
Var
List : ListType;
Name : String;
Procedure GetList (Var List: ListType); . . .
Function Member (Name : String; List : ListType) : String;
Begin
If List = nil
Then Member := ‘no’
Else If Name = List^.First
Then Member := ‘yes’
Else Member := Member ( Name, List^.Rest)
End;
Begin
Readln ( Name );
GetList ( List );
Writeln (Member ( Name, List ) )
End .
Pascal
( define ( guest name list )
( cond
( ( empty? list ‘no )
( ( equal? name ( first list )) ‘yes )
( else ( guest name ( rest list )) ) ))
Scheme
![Page 60: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/60.jpg)
#include <stdio.h>#include <stdio.h>
typedef struct listCell * list;typedef struct listCell * list;
struct listCell {struct listCell {
int first;int first;
list rest;list rest;
};};
bool bool guestguest (int (int xx, list , list ll) {) {
if (l if (l == == NULLNULL))
return return false;false;
else if (x else if (x == == (l (l -> -> first))first))
return return true;true;
elseelse
return return guest (x, l guest (x, l -> -> restrest););
}}
int main (int argc, char ** argv) {int main (int argc, char ** argv) {
list l1, l2, l3 = NULL; int x;list l1, l2, l3 = NULL; int x;
l1 = (list) malloc (sizeof (struct listCell));l1 = (list) malloc (sizeof (struct listCell));
l2 = (list) malloc (sizeof (struct listCell));l2 = (list) malloc (sizeof (struct listCell));
l2 -> first = 3; l2 -> rest = l3;l2 -> first = 3; l2 -> rest = l3;
l1 -> first = 2; l1 -> rest = l2;l1 -> first = 2; l1 -> rest = l2;
scanf ("%d", &x);scanf ("%d", &x);
printf ("%d\n", member (x, l1));printf ("%d\n", member (x, l1));
}}
C or C+C or C+++
( define ( guest name list )
( cond
( ( empty? list ‘no )
( ( equal? name ( first list )) ‘yes )
( else ( guest name ( rest list )) ) ))
Scheme
![Page 61: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/61.jpg)
Principles of Program Design
• K.I.S.S.: Keep It Simple Syntactically
• Recursion Is Natural
• D3: Data Drive Design
![Page 62: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/62.jpg)
The Ping-Pong Game
9th Graders With
• Algebra I
• 12 Weeks of
Scheme
![Page 63: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/63.jpg)
Curriculum Comparison
• introduction• syntax• Turbo Pascal, i/o• numbers, strings• simple arithmetic• text files• conditionals• procedures, stubs
• algebra, functions• conditionals• design recipes• symbols• linked lists• structures, records• graphics• lists containing lists
![Page 64: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/64.jpg)
The Programming Environment
Salient DrScheme features:• interactive evaluation• immediate error-reporting with
source highlighting• language presented as a sequence
of increasingly complex layers
![Page 65: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/65.jpg)
Putting it in Context
![Page 66: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/66.jpg)
What a University Saw
Universities like Rice admit some of the best students in the nation; yet, the students cannot
• develop a program systematically• separate problem solving from
machine details• explain why a program works (or
doesn’t)
![Page 67: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/67.jpg)
What the ETS Wishes You Didn’t Know (~1998)
024681012141618
LibArts Univ Engg CompSci
Scheme C++ Older
![Page 68: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/68.jpg)
Conclusion
• Computer science education is undergoing a revolution
• TeachScheme! is at the forefront
• Schools and universities must collaborate to reap the benefits
![Page 69: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/69.jpg)
What We Offer
• Textbook (How to Design Programs)• DrScheme programming environment• Teacher’s guide• Programming environment guide• Exercises and solution sets• Miscellany: help, summer course, etc
All available for free!
![Page 70: The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5518d0bd550346b31f8b5c9d/html5/thumbnails/70.jpg)
Web Information
See
http:/www.teach-scheme.org/
for information about the project, especially the free summer courses