Hello, Alain.  You might wish to write out htdp.org design recipes for EnumVarDim and Enum.  I don't know what they're supposed to do, but is the below code closer to what you want?

#lang racket/base

(define (Enum x)
  (fprintf (current-error-port) "TODO: implement Enum\n")
  x)

(define (EnumVarDim dim value)
  (if (>= dim 2)
      (Enum value)
      value))

(define pairValue (EnumVarDim 111 222))

(printf "pairValue = ~S\n" pairValue)


In this code, the value of pairValue isn't being set inside EnumVarDim.  Instead, the value of pairValue is set outside of EnumVarDim, to the value of applying EnumVarDim.

(BTW, if you wish to try Racket naming conventions, you could use names like enum-var-dim and pair-value.)

--
You received this message because you are subscribed to the Google Groups "Racket 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to