Slacker News Slacker News logo featuring a lazy sloth with a folded newspaper hat
  • top
  • new
  • show
  • ask
  • jobs
Library
← Back to context

Comment by Lio

7 hours ago

I think they've missed a trick there, they could have used `|` like low-type does.

e.g.

  def greet(name: String | "Hello"): String

I know it's all subjective but I think that reads better and it's valid ruby.

To be honest low-type with a static analysis tool would be my favourite syntax for this.

https://github.com/low-rb/low_type

0 comments

Lio

Reply

No comments yet

Contribute on Hacker News ↗

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities