val fruits = List("apple", "banana", "avocado", "papaya") val countsToFruits = // count how many 'a' in each fruit fruits.groupBy(fruit => fruit.count(_ == 'a')) for (count, fruits) <- countsToFruits do println(s"with 'a' × $count = $fruits") // prints: with 'a' × 1 = List(apple) // prints: with 'a' × 2 = List(avocado) // prints: with 'a' × 3 = List(banana, papaya)
We are very pleased to announce the release of Scala 2.11.2! Get started with the Hello Scala 2.11 template in Typesafe Activator Download a distribution from scala-lang.org Obtain it via Maven Central Scala 2.11.2 is a bugfix release that is binary compatible with previous releases in the Scala 2.11 series. The changes include: Several issues in the collections library were resolved, most notably
Packages package root This is the documentation for the Scala standard library. This is the documentation for the Scala standard library. Package structure The scala package contains core types like Int, Float, Array or Option which are accessible in all Scala compilation units without explicit qualification or imports. Notable packages include: scala.collection and its sub-packages contain Scal
This is the specification of a previous version of Scala. See the Scala 2.13 spec. Syntax Summary The following descriptions of Scala tokens uses literal characters ‘c’ when referring to the ASCII fragment \u0000 – \u007F. Unicode escapes are used to represent the Unicode character with the given hexadecimal code: UnicodeEscape ::= ‘\’ ‘u’ {‘u’} hexDigit hexDigit hexDigit hexDigit hexDigit ::= ‘0’
⚠️ Beware of Scams: since Feb 2024, scammers are using fake Scala websites to sell courses, please check you are using an official source. We on the Scala team would like to call some attention to a lesser-known but crucial component of the development effort behind Scala. It’s called the Scala community build. What is it? It’s a collection of open-source Scala code that includes many of the most-
⚠️ Beware of Scams: since Feb 2024, scammers are using fake Scala websites to sell courses, please check you are using an official source. A privilege escalation vulnerability (CVE-2017-15288) has been identified in the Scala compilation daemon. We recommend upgrading to the latest versions of Scala (Scala 2.12.4, Scala 2.11.12 or Scala 2.10.7). The compile daemon is started explicitly by the fsc
Packages package root This is the documentation for the Scala standard library. This is the documentation for the Scala standard library. Package structure The scala package contains core types like Int, Float, Array or Option which are accessible in all Scala compilation units without explicit qualification or imports. Notable packages include: scala.collection and its sub-packages contain Scal
Packages package root This is the documentation for the Scala standard library. This is the documentation for the Scala standard library. Package structure The scala package contains core types like Int, Float, Array or Option which are accessible in all Scala compilation units without explicit qualification or imports. Notable packages include: scala.collection and its sub-packages contain Scal
class ArrayBuffer[A] extends AbstractBuffer[A], IndexedBuffer[A], IndexedSeqOps[A, ArrayBuffer, ArrayBuffer[A]], StrictOptimizedSeqOps[A, ArrayBuffer, ArrayBuffer[A]], IterableFactoryDefaults[A, ArrayBuffer], DefaultSerializable An implementation of the Buffer class using an array to represent the assembled sequence internally. Append, update and random access take constant time (amortized time).
TmplDef ::= [`case'] `class' ClassDef | [`case'] `object' ObjectDef | `trait' TraitDef ClassTemplate ::= [EarlyDefs] ClassParents [TemplateBody] TraitTemplate ::= [EarlyDefs] TraitParents [TemplateBody] ClassParents ::= Constr {`with' AnnotType} TraitParents ::= AnnotType {`with' AnnotType} TemplateBody ::= [nl] `{' [SelfType] TemplateStat {semi TemplateStat} `}' SelfType ::= id [`:' Type] `=>' |
I've profiled Scala using NetBeans (which I believe just embeds VisualVM in NetBeans), but it's tricky. If you're just starting out, I'd suggest just using the -Xprof option. That just prints statistics when the program exits. Of course if you are launching your program using "scala MyProgram" then you need to set -Xprof via the JAVA_OPTS environment variable because you can't pass it on the com
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く