Ticket #183 (new defect)
dracula rename export example from reference docs does not work
Reported by: | pnkfelix | Owned by: | cce |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | cce/dracula.plt | Keywords: | |
Cc: | Version: | ||
Racket Version: | 4.1.5 |
Description
Here is (slightly modified) code from the 8.2 reference manual:
(interface IAssociative (sig mulop (x y)) (con mulop-associative (equal (mulop a (mulop b c)) (mulop (mulop a b) c)))) (interface ICommutative (include IAssociative) (con mulop-commutative (equal (mulop a b) (mulop b a)))) (interface IDistributive (include IAssociative) (include ICommutative) (sig addop (x y)) (con addop/mulop-distributive (equal (mulop a (addop b c)) (addop (mulop a b) (mulop a c))))) (module MDistributiveA (defun add (a b) (+ a b)) (defun mulop (a b) (* a b)) (export IAssociative (addop add)) (export ICommutative (addop add)) (export IDistributive (addop add))) (module MDistributiveB (defun add (a b) (+ a b)) (defun mul (a b) (* a b)) (export IAssociative (addop add)) (export ICommutative (addop add)) (export IDistributive (addop add) (mulop mul)))
Hitting RUN for this example raises the following error:
. mulop: undefined in: mulop
(it also highlights the mulop in the IAssociative interface, which is not terribly useful and may be a usability bug; read on for why I think this.)
If I comment out the definition of MDistributiveB, so that MDistributiveA is the only module providing relevant exports, then the code runs fine.
I assume the problem here is something along the lines of "the docs should be changed so that the MDistributive module exports mul/mulop instead of add/addop into the IAssociative interface.
More generally, all of the examples in the dracula docs need to be tested directly.