Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有一种单行(或功能性的方式)来做到这一点?
val a = b a.foreach(_.sideEffectFunc()) return a
b.map(x => { x.sideEffectFunc(); x })