Consider this program (a poem of a real problem I encountered):
#lang racket
(module server racket
(provide c%)
(define c%
(class object%
(super-new)
(define/public (m) 0))))
(module client racket
(require (submod ".." server))
(define-local-member-name m)
(define d%
(class object%
(super-new)
(define/public (m o)
(displayln (interface->method-names (object-interface o)))
(send o m))))
(module+ test
(require (submod ".."))
(send (new d%) m (new c%))))
(require (submod 'client test))
If you run this, you will get
Welcome to DrRacket, version 6.4.0.14--2016-03-19(-/f) [3m].
Language: racket, with debugging.
(o has methods: (m))
. . send: no such method
method name: m
class name: c%
So right after confirming that ‘m' is a method of o, our dear friend Racket
tells us that m is not a a method of o.
I get it. The define-local-member-name ‘kills' the ‘m’ from ‘server’ as well as
client outside of the scope, but that’s because Racket fails to acknowledge
that some positions are referentially transparent and some are not when it
replaces ‘m’ with the gensym-ed identifier that replaces it in scope.
I really would like this program to run and if not, I’d like to record it here
why our implementation (as opposed to a specification) fails.
— Matthias
--
You received this message because you are subscribed to the Google Groups
"Racket Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/racket-dev/F72F48F3-1989-42B9-8369-E8C96362C1DD%40ccs.neu.edu.
For more options, visit https://groups.google.com/d/optout.