[plt-scheme] Using student-defined structures in a teachpack

From: Carl Eastlund (carl.eastlund at gmail.com)
Date: Sun Dec 11 02:19:02 EST 2005

On 12/11/05, Mike Burns <mike at mike-burns.com> wrote:
> I'm actually wrapping functions which take Posns. The idea was to have the
> student create her own data structure but have it play nicely with the rest
> of the system, giving them quick satisfaction. The problem they need to
> solve is something like:
>
>   We've been dealing with single values, but to play Battleship we need two
>   numbers. Once you have a way of representing two numbers then we can play
>   Battleship.
>
> You do raise good points; maybe we'll just use Posns instead.

Of course, depending on the context in which this is assigned, you
could always ask students to write a data definition for point-like
data, list the constructors/selectors this creates and so forth, then
for part 2 ask them to solve a problem using your provided datatype
instead so they can use helpful procedures like point->pair and so
forth.  If this is presented over time so they see part 2 later that
works; if they get it all at once they'll be able to copy and rename
the provided data definition.

--Carl


Posted on the users mailing list.