Unfortunately, `x.setBits(@[0, 1, 2, 3])` doesn't work for me. It is possible 
to use bitwise operations, though: 
    
    
    var x = 1'u8
    let range = 0 .. 3
    x = x or ((1'u8 shl len(range)) - 1'u8)
    echo x # 15
    
    
    Run

Note that this only works if range looks like `0 .. n`, and would require 
further modification to work with ranges like `4 .. 7`.

Reply via email to