How to do a parametrizable access to a bit slice

This assign_value function begs the question of, why does this restriction still exist in the language?