[plt-scheme] getting Prog Lang : Application and Interpretation working under DrScheme

From: Shriram Krishnamurthi (sk at cs.brown.edu)
Date: Thu Sep 16 08:36:56 EDT 2004

Thanks for your interest in PLAI.

If you're downloading plai.plt from the book's home page, please note
that there is a far newer, 208-friendly version in the software
section  of my course.  I am changing the book slightly (to use a
construct called DEFINE-TYPE instead of the EoPL DEFINE-DATATYPE).

Regardless, the problem you're having is of expecting the support
library to contain all the book's solutions!

> Should I be able to just type
> (parse '3) and get
> #(struct: num 3) back ?

Nope.  You have to write the implementation of PARSE.  The code is in
the book for a very rudimentary version of PARSE, and then you're
expected to be able to build subsequent versions of PARSE yourself
(but it's really easy to extend the rudimentary version for these
purposes).

> so I type the definition of parse (from  Section 1.3 - page 7) into the 
> definitions (with trepidation, 'cos "num" isn't familiar!)
> and it accepts the definition
> and then
> (parse (read))
> -> reference to unidefined identifier: num

Did you create the datatype definition?

> Yep..
> 
> What do I need to do to get this to worK??

You're getting upset.  Please don't.  Instead, read the book as you
try to run the code.  The book tells you, in section 1.2 (Modeling
Syntax), that you need to create a datatype definition.  The parser
consumes the output of READ and creates insteaces of this datatype.
So you have to type in the (define-datatype ...) or (define-type ...) 
expression given in the book.

If you have further problems, please ask away.

Good luck with the material.

Shriram


Posted on the users mailing list.