[racket] are these right structs and contracts

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Mon Jul 2 12:50:59 EDT 2012

On Jul 2, 2012, at 12:39 PM, Roelof Wobben wrote:

> (define-struct VZoo (Vcat Vcham))
> ; Zoo - (make-Vzoo struct struct)
> ; interp. (make-Vzoo Vcat Vcham) where Vcat and Vcham are both structs containing the parameters of that particular struct.

So far so good. 


> ; make-Vzoo Vcat Vcham -> Vzoo

You never took my advice to write it like this

make-Vzoo ; Vcat Vcham -> Vzoo 


> And if I want to know the happiness of a Vcat must I use (Vcham-H Vcham) or do i have to use Vzoo( Vcat (Vcham-H Vcham)
> As I understand it right Vcat is now a part of Vzoo.

Time to 'play' aka experiment. 

A data definition is a recipe for producing examples of data. It says so in the book. Make 2 examples of Vchams, Vcats, and Vzoos each. I start: 

(define vcham1 (make-Vcahm 1 2 3))

You may use previously defined data -- Matthias




Posted on the users mailing list.