Some of you may have seen this in yestersdays IRC logs:
    
    
    18:20:41    FromGitter      <kayabaNerve> Anyone here know why {.pure.} 
was removed?
    18:20:57    FromGitter      <kayabaNerve> I'd love to force scoping 
enums...
    18:24:11    FromGitter      <Araq> yeah, I removed it because it sucked 
big time
    18:24:26    FromGitter      <Araq> my rationale is in some github issue
    18:26:33    FromGitter      <Araq> if you want to treat the users of your 
libraries like little children, give your enum fields annoying overly long 
names instead
    18:27:01    federico3       urgh
    
    
    Run

Can that be true?

So we have to replace
    
    
    type
      PoliceAlertState {.pure.} = enum
        green, yellow, red
      
      TextMarkColor {.pure.} = enum
          green, yellow, red, blue
    
    type
      City = object
        alertLevel:  PoliceAlertState
    
    var detroit: City
    
    if detroit.alertLevel == PoliceAlertState.red:
      discard # do some action()
    
    
    Run

by
    
    
    type
      XPoliceAlertState = enum
        PoliceAlertStateGreen, PoliceAlertStateYellow, PoliceAlertStateRed
      
      XTextMarkColor = enum
          TextMarkColorGreen, TextMarkColorYellow, TextMarkColorRed, 
TextMarkColorBlue
    
    type
      XCity = object
        alertLevel:  XPoliceAlertState
    
    var xdetroit: XCity
    
    if xdetroit.alertLevel == PoliceAlertStateRed:
      discard # do some action()
    
    
    Run

Reply via email to