[plt-scheme] Trouble using map with object methods

From: Marc Fernandez Vilaseca (pseudomarc at gmail.com)
Date: Sat Jul 9 18:05:30 EDT 2005

Hi all, 

I hope someone can help me with this. I am just beginning to learn
Scheme, and I'm probably making some dumb mistake.

When I run the following code under MzScheme/MrEd I get the error
"send: target is not an object: an-object for method: double":

(define a-class 
  (class object%
    (define/public (double x) (* 2 x))

(define an-object
  (new a-class))

(define another-object
  (new a-class))

(define a-list
  '(an-object another-object))

(define (map-double object-list)  
   (lambda (item)
     (send item double 3))

(map-double a-list)

Anyone can see what's wrong with the code above?

Many thanks,


Posted on the users mailing list.