“With” statement equivalent for Scala?

前端 未结 6 889
野的像风
野的像风 2021-02-13 10:31

Idle pondering from a Scala learner perhaps, but ... in my tinkerings I\'ve written the following:

( n.child.size > 0 ) && ( n.child.filter( ! _.isIns         


        
6条回答
  •  难免孤独
    2021-02-13 10:38

    {
        import n.child._
        ( size > 0 ) && ( filter( ! _.isInstanceOf[Text] ).size == 0 )
    }
    

提交回复
热议问题