[plt-scheme] *const

From: David Van Horn (dvanhorn at ccs.neu.edu)
Date: Sun Apr 5 15:45:47 EDT 2009

On Apr 3, 2009, at 9:56 AM, Jon Loldrup wrote:
 > Hi
 > I'm working through The Little Schemer and I've comed to the point
 > where they introduce types (page 181). They use terms like:
 > *const
 > *quote
 > *identifier
 > *lambda
 > *cond
 > but I wonder how I type these names in DrScheme? When I try to
 > implement the atom-to-action function (see below) DrScheme says this:
 > "*const: name is not defined, not a parameter, and not a primitive
 > name"

Matthias Felleisen wrote:
> I forgot what we did there. But we either mean '*const or (define *const 
> '*const). -- Matthias (not anywhere near a copy of the book)

Nope; I have a copy -- there are definitions given for *const, *quote, 
etc.  They start on page 182.  Here is an example:

(define *const
   (lambda (e table)
     (cond ((number? e) e)
           ((eq? e #t) #t)
           ((eq? e #f) #f)
           (else (build (quote primitive) e)))))

Jon, if you want to use atom-to-action function, you'll need to define 
each of these *-functions as given in the book.

Rereading this part of TLS, I can only conclude that this was written 
before Matthias visited the pope.


Posted on the users mailing list.