3 ms·
a = [] of Int32|String a << 1 a << "two" works, however. So while it isn't exactly the same, it is pretty close.
by yxhuvud 10y ago
a = [] of Int32|String
a << 1
a << "two"
works, however. So while it isn't exactly the same, it is pretty close.
- rubyfan 10y agoThat's the point. It's close but different enough that I've got to context switch to get the benefits of Crystal. So I wouldn't use it as a replacement for Ruby since it's a downgrade. Since I'm relegating it to areas where I need it's benefits (I and others perceive it to be primarily performance if you're already using Ruby) then I'd just as easily switch out to C or Java or Rust for that matter.