[racket] message passing
May be we can help better with a reference to the exercise.
I really can't make up what you are trying to do.
Jos
_____
From: users-bounces at racket-lang.org [mailto:users-bounces at racket-lang.org]
On Behalf Of iam_here at aol.in
Sent: 08 August 2010 19:20
To: users at racket-lang.org
Subject: [racket] message passing
Hello schemers
what if I have program of massage passing and I have to return the object
when it is defined.
example-
(define (single-order)
(let (
(delivery #f)
)
(define (the-order req)
(cond ((eq? req 'available) available)
(else (error "the-order: unknown req: " req))
)
)
(define (available)
(set! delivery #t))
the-order
)
)
(define (available object)
((object 'available)))
=> now when I will run it like
(define mcdon(single-order))
- it should return mcdon instead of <#unspecified>
Any ideas??
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20100808/8425c37d/attachment.html>