[plt-scheme] *const
I forgot what we did there. But we either mean '*const or (define
*const '*const). -- Matthias (not anywhere near a copy of the book)
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"
>
> this is the function:
>
> (define atom-to-action
> (lambda (e)
> (cond
> ((number? e) *const)
> ((eq? e #t) *const)
> ((eq? e #f) *const)
> ((eq? e '(cons)) *const)
> ((eq? e '(car)) *const)
> ((eq? e '(cdr)) *const)
> ((eq? e '(null?)) *const)
> ((eq? e '(eq?)) *const)
> ((eq? e '(atom?)) *const)
> ((eq? e '(zero?)) *const)
> ((eq? e '(add1)) *const)
> ((eq? e '(sub1)) *const)
> ((eq? e '(number?)) *const)
> (else *identifier))))
>
> kind regards Jon Loldrup, Denmark
> _________________________________________________
> For list-related administrative tasks:
> http://list.cs.brown.edu/mailman/listinfo/plt-scheme