Here you are: 
    
    
    type
      BitDepth = enum
        BD8, BD16, BD24, BD32, BD64
      FileBits = object
        case kind: BitDepth:
        of  BD8:  smpl8: uint8
        of BD16: smpl16: uint16
        of BD24: smpl24: uint32
        of BD32: smpl32: uint32
        of BD64: smpl64: uint64
    
    
    Run

The catch is, it's not any better and you can't really use it anyway without 
[generics](https://nim-lang.org/docs/manual.html#generics) or lots of `case` 
branching each time you process `FileBits`.

Reply via email to