What is the accepted/recommended syntax for Scala code with lots of method-chaining?

前端 未结 6 1165
死守一世寂寞
死守一世寂寞 2021-02-05 06:29

In Scala I tend to favour writing large chained expressions over many smaller expressions with val assignments. At my company we\'ve sort of evolved a style for th

6条回答
  •  天命终不由人
    2021-02-05 06:34

    Here's how extempore does it. You can't go wrong.

    (specMember
      setInfo   subst(env, specMember.info.asSeenFrom(owner.thisType, sym.owner))
      setFlag   (SPECIALIZED)
      resetFlag (DEFERRED | CASEACCESSOR | ACCESSOR | LAZY)
    )
    

    Authentic compiler source!

提交回复
热议问题