[plt-scheme] A couple "Lazy Scheme" questions

From: Eli Barzilay (eli at barzilay.org)
Date: Wed Jul 5 22:06:46 EDT 2006

On Jul  5, Psy-Kosh wrote:
> I downloaded and installed the csu660.plt thing, and its's neat,
> though I've got a couple questions:
> 
> First, is it possible to just extract that bit from the rest, so I
> can get rid of the "handin" button and such?

If you just want the lazy functionality, you can remove the first tool
in the info.ss file -- change this

  (define tools      `(("client-gui.ss") ("langs.ss")))
  (define tool-names `(,name #f))
  (define tool-icons `(("icon.png" ,collection) #f))

to:

  (define tools      `(("langs.ss")))
  (define tool-names `(,name))
  (define tool-icons `(("icon.png" ,collection)))

or you can remove it completely if you want to use it as a module.


> Second, I looked at the site for more info on it, and in the class
> notes there was usage of a "define-type", but I couldn't find
> anywhere an explanation of the implied type system, that is, how to
> use the generated types and so on, so if anyone could point me in
> the right direction for those docs, I'd appreciate it, thanks.

There are plenty of examples for defining and using these types.  The
only two constructs you need to know about are `define-type' and
`cases' -- the first defines a type, and the second destructs an
instance (through pattern matching).  Alternatively, you can see PLAI
or EoPL -- and consider `define-type' and `cases' as variations with
slightly different syntax than used in those books.

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!


Posted on the users mailing list.