scala
美
英 
例句
It has always been a dream of mine to write Eclipse plug-ins in other languages like JavaScript, Groovy or Scala.
我一直有個夢想——使用其它語言如JavaScript、Groovy或Scala編寫Eclipse插件。
The list-construction operators in Scala make the return conditions for both cases quite readable and easy to understand.
Scala中的列表構造操作符使得這兩種情況下的返回條件變得非常易讀、易于理解。
In the case of XPath, you are able to use certain parts of XPath syntax directly in Scala, as it just gets translated into a function call.
在XPath中,由于可以被轉換成一個函數(shù)調用,您可以在Scala中直接應用XPath語法的某一部分。
Recall that type information is often inferred in Scala (unlike Java), meaning we don't always show type annotations explicitly.
回想一下,類型信息在Scala中經(jīng)常是被推斷出來的(不像Java),這意味著我們并不總是需要顯式的聲明類型。
You should now be prepared to read a fair bit of Scala code, but there's plenty more about the language to put in your tool belt.
你現(xiàn)在應該準備好閱讀更多的Scala代碼了,但是這門語言仍然有很多的知識可以讓你充實起來。
It still wanted half an hour of sunset as he left the door of the Scala palace.
他走出斯卡拉府第大門的時候,離太陽落山還有半個小時。
Before we begin, I'll lay out a few functional concepts that are required to understand why Scala looks and acts the way it does.
開始之前,我將列出一些必要的函數(shù)概念,以幫助理解為何Scala以這種方式操作和表現(xiàn)。
If I am trying to develop some software that works on binary data, I don't want Scala to optimize for me behind the scenes.
如果我要開發(fā)的某種軟件是用來操作二進制數(shù)據(jù)的,我可不希望Scala在屏幕后面為我做什么優(yōu)化。
Scala combined with Spring makes it quite easy to transparently inject services into all kind of objects instantiated at runtime.
Scala與Spring的整合可以在運行期輕松將服務透明地注入到各種對象中。
Java programmers looking to call into Scala should also be familiar with traits as a mechanism for using Scala.
希望使用Scala的Java程序員也應熟悉特征,將其作為使用Scala的一種機制。
But enough of the abstract overview: programmers like to see code, so let's take a look at what Scala can do.
但抽象概述并不夠:程序員喜歡看代碼,所以讓我們來看一下Scala可以做什么。
Both Fan and Scala are trying to take software scalability to the next level, but I think we are taking different paths to get there.
Fan和Scala都企圖將軟件可擴張性發(fā)展到新的階段,但我想我們為此采取的方式不同。
Using Scala just for the tests meant we got to use it in anger without impacting production code directly.
只用Scala寫測試,就不直接影響產(chǎn)品代碼,我們還能忍著怒氣繼續(xù)用Java。
Remember that the compiler can pull all sorts of tricks, just as long as the final result obeys the semantic meaning of the Scala language.
請記住,編譯器可以容納所有技巧,只要最終結果符合Scala語言的語義含義即可。
Scala is an attempt to incorporate functional concepts and terseness without losing the richness of the object paradigm.
Scala將函數(shù)概念與簡潔性相融合,同時又未失去對象的豐富特性。
Note that the return value of a get on a Scala Map is not the actual value corresponding to the passed key.
注意,ScalaMap中get的返回值實際上并不對應于傳遞的鍵。
In practice, I've never seen this happen with a trivial example so I guess we'll have to take the Scala designers' word for it.
(在實踐中,我還沒有見過在簡單的示例中出現(xiàn)這種效果,所以我想我們只能暫且相信Scala設計者的說法)。
Scala enables you to define a new construct that lies halfway between an interface and a class, called a trait.
Scala使您能夠定義處于接口和類之間的新型結構,稱為特征(trait)。
The hotel is also close to the Stock Exchange, the La Scala Opera House; and is within walking distance of shopping malls and boutiques.
酒店也鄰近股票交易所、斯卡拉劇院(LaScala),距離購物中心及高級商店幾步之遙。
The stack is made up of Rails for the front side, C, Scala and Java for the middle business layer, and MySQL for storing data.
其結構是用Rails作前端,C,Scala和Java組成中間的業(yè)務層,使用MySQL存儲數(shù)據(jù)。
Tuples are not a game-changing feature, just another one of those "niceties" that makes Scala a powerful language to use.
元組并不是一個非常具有變革性的特性,它只不過是又一個使Scala成為強大語言的優(yōu)秀特性。
When we were learning new Scala features, we chose whether to use them based on whether the intent of the resulting code was more obvious.
在我們學到Scala新特性的時候,我們會根據(jù)代碼是不是能夠更明確的體現(xiàn)出實現(xiàn)意圖來決定用不用。
Scala's case classes and its built-in support for pattern matching model algebraic types used in many functional programming languages.
Scala的case類及其內置支持的模式匹配模型代數(shù)類型在許多函數(shù)式編程語言中都被使用。
18th century magnificent opera house, built similarly to La Scala in Milan and San Carlos in Naples, is one of the prettiest in Europe.
18世紀的宏偉歌劇院,建成類似斯卡拉米蘭和圣卡洛斯在那不勒斯,是歐洲最漂亮的一個。
We ended the last chapter with a few "teaser" examples of Scala code.
在上一章我們以幾個撩撥性質的Scala代碼范例作為章節(jié)結束。
This expression is actually the body of an "anonymous function" , called a function literal in Scala.
這個表達式實際上是一個“匿名函數(shù)”的函數(shù)體,在Scala中稱為字面函數(shù)。
You may have noticed that the compiler did not complain when the file was named upper3. scala and the object was named Upper.
你可能已經(jīng)注意到編譯器并沒有因為文件名為upper3.scala而object名為Upper而抱怨。
The only drawback is that the methods do not actually exist in Scala code and cannot, thus, be called by other Scala code.
惟一的缺陷是這些方法并不實際存在于Scala代碼中,因此其他Scala代碼無法調用它們。
You can see from the above example that Scala allows classes to be declared inside one another, or "nested" .
你可以從上面的例子中看到,Scala允許在一個類中定義另外一個,或者成為“嵌套”。
If I asked you to describe Scala in a sentence, how would that sentence look like?
如果要您用一句話來描述Scala,您會怎么說?
So I can only imagine how hypnotizing those songs and anthems can be live at the Scala del Calcio.
因此我只能想象置身于現(xiàn)場時這些加油歌和贊美詩將是多么地令人心馳神往。
Since Scala enumerations are just regular objects, you could use any object with vals to indicate different "enumeration values" .
因為Scala的枚舉值是通常的對象,你可以使用任何val對象來指示不同的“枚舉值”。
Have fun with that, and let me know if you find work programming in Scala!
愿您從中找到樂趣,如果發(fā)現(xiàn)了用Scala編程的工作,別忘了告訴我!
InfoQ: So how do you think Scala will look like in 5 years in terms of the language and its surrounding ecosystem?
那么從語言和周邊生態(tài)環(huán)境的角度來看,您覺得Scala在5年后會是什么樣子呢?
Martin Odersky: The company aims to provide the best products and support for commercial and community users of Scala.
MartinOdersky:公司的目標是為Scala的商業(yè)用戶和社區(qū)用戶提供最好的產(chǎn)品和支持。
Look carefully at what the scala interpreter said the first command returned, double (Int)Unit.
仔細看scala解釋器給出的第一個命令的返回值,double:(Int)Unit。
The only static feature the Scala language offers is (companion) objects, whose counterparts in Java are singletons.
Scala語言所提供的唯一一個靜態(tài)特性就是對象,其在Java中的等價物就是單例。
The Scala compiler is easily able to infer this information, so there's no need to be redundant.
Scala編譯器可以輕松推斷出該信息,所以不需要多此一舉。
In Scala, the last expression in a function is the return value, although you can have return statements elsewhere, too.
在Scala中,函數(shù)的最后一個表達式就是返回值,盡管你也可以在其它地方使用return語句。
The feature uses reflection, and works not only for Scala code but just as well with Java.
該特性使用到了反射,不僅可以用于Scala代碼,還適用于Java。