I use an Enum like this:
    
    
    LocationOption* = enum
      locHere, locThere
    
    
    Run

and have then the following program construct:
    
    
    case location
    of locHere:
      let msg = "I'm here!"
    of loThere:
      let msg = "You're there!"
    
    echo &"And Shakespeare said: {msg}"
    
    
    Run

This doesn't compile, because `msg` is not in scope on the top level. However 
if I declare the variable `msg` on the top level, I have to declare it as 
mutable `var` and re-assign it in the case statement.

**_Is there a way to avoid this use of `var` and still declare `msg` it as a 
immutable reference (with `let`)?_**

* * *

Side note: This might be a trivial question, but I have forgotten a lot of Nim 
and want to find my feet back into it after more than a year of defection into 
Python... 

Reply via email to