[racket] else: not allowed as an expression in: else

From: Danny Yoo (dyoo at cs.wpi.edu)
Date: Tue Dec 21 19:29:16 EST 2010

On Tue, Dec 21, 2010 at 3:57 PM, Niitsuma Hirotaka
<hirotaka.niitsuma at gmail.com> wrote:
> I try to run this code on racket
> http://www.daniweb.com/forums/thread277930.html
> After little modify I enables run this code on swindle.
> But when I chose language racket, this code cause error
> else: not allowed as an expression in: else

The eopl/eopl module is providing its own version of the conditional
form 'cond'.  The error you're seeing is because it is not cooperating
with racket's else.

One way to resolve this is to only use the eopl bindings for
define-datatype and cases, which you can do like this:

;; Comment out the original require to eopl/eopl
;; (require eopl/eopl)
;; and replace it with this:
(require (only-in eopl/eopl

However: is there a reason why the whole module isn't just written in
#lang eopl?

Posted on the users mailing list.