[plt-scheme] *const

From: Jon Loldrup (loldrup at gmail.com)
Date: Fri Apr 3 09:56:57 EDT 2009

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20090403/f2cba7c4/attachment.html>

Posted on the users mailing list.