News for hackers. Stuff that matters.
Re:"Useless Ruby sugar": Endless (one-line) methods by kagakuninja on Friday December 01, 2023 @02:38PM (#38491191)
Not a Ruby guy, but Scala uses that syntax for all method declarations:

    // type annotations are optional, if the compiler can infer them
    def foo = 42

    def bar(x: Int): String = {
      // stuff
    }
It works fine IMO. Scala 3 introduced Python-style syntax, in which {} is optional:

    def bar(x: Int): String =
      // stuff
    end bar // end is optional

There are no comments on this comment yet.