3 ms·
I worked exclusively in Ruby for many years and this was never a problem I experienced. Or if I did it was such a non issue it was fixed and moved on. I can ag
by mberning 3y ago
I worked exclusively in Ruby for many years and this was never a problem I experienced. Or if I did it was such a non issue it was fixed and moved on.
I can agree that the behavior of casting to a number type should probably be undefined. But a null becoming an empty set seems fine to me.
- vidarh 3y agoInteger(nil) will raise a TypeError, as will Integer("4x"), but not Integer("4"), so when you want that behaviour, just use Integer(), or Integer.try_conver() if you want it to return nil instead of raising an exception.