tags:

views:

120

answers:

1

When I try to run (define-type on DrScheme, I got error "reference to an identifier before its definition: define-type", what is it happening?

I input:

(define-type GUI
    [label (text string?)]
    [button (text string?)
            (enabled? boolean?)])

and I get result:

reference to an identifier before its definition: define-type

thanks.

Robert

+2  A: 

define-type is not part of "basic" Scheme, it is part of "Typed Scheme". To use this language in Dr Scheme:

Make sure "Module" is selected in the dropdown at the bottom left of the window. Then in the top window, enter:

#lang typed-scheme

and press the "run" button.

anon
Thanks.I did this.My program at the top window is now:#lang typed-scheme (define-type shape [square (side number?)] [rect (height number?) (width number?)] [circle (radius number?)])but I still got error:expand: unbound identifier in module in: define-typecould you help me?
Robert
@Robert Sorry, it looks as if I was wrong define-type-alias is from Typed Scheme, I'm not sure where you are getting define-type from. Can you post the URL for your source?
anon
`define-type` is from the language that is specific to PLAI. Ask your instructor where to get it and how to install it.
Eli Barzilay