至少根据 IntelliJ Idea,Scala 不建议使用后缀形式。我想我什至读过它。虽然建议使用中缀。我想知道,这里的表格是什么:
val out = new OutputStreamWriter(connection.getOutputStream)
out write text // infix
out flush () // postfix or infix?
我本来可以写out flush()的,它会是后缀形式,对吗?
但是,我也可以这样做out flush ()(注意空格),它似乎是中缀形式 where outis an object, flushis a method and ()- is empty parameter list of type Unit- 就像out write text, 但不是text我们有Unitor ( )。
这是后缀还是中缀形式?