4 ms·
Static type-signatures are inevitable in general. You can see this by how even the Ruby documentation has to make up silly ad hoc notation like "→ array_of_stri
by frou_dh 1y ago
Static type-signatures are inevitable in general. You can see this by how even the Ruby documentation has to make up silly ad hoc notation like "→ array_of_strings", "→ matchdata or nil" etc.
(Random example): https://docs.ruby-lang.org/en/3.4/String.html#method-i-lines https://docs.ruby-lang.org/en/3.4/String.html#method-i-lines
- Lio 1y agoThat's just documentation tool but the method is actually already statically typed by ruby. I'm not sure why they don't link that in the documenation but I beleive it is something the RDoc mainer wants to do. def lines: (?string? separator, ?chomp: boolish) -> Array[String] | (?string? separator, ?chomp: boolish) { (String line) -> void } -> self https://github.com/ruby/rbs/blob/master/core/string.rbs https://github.com/ruby/rbs/blob/master/core/string.rbs