Skip to content

Commit a505bd9

Browse files
committed
Merge branch 'master' of github.com:scala/scala.github.com
2 parents 53dc790 + 97ba301 commit a505bd9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1196
-136
lines changed

_layouts/redirected.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
layout: default
3+
---
4+
<!DOCTYPE html>
5+
<html>
6+
<head>
7+
<link rel="canonical" href="{{ page.redirect_to }}"/>
8+
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
9+
<meta http-equiv="refresh" content="0;url={{ page.redirect_to }}" />
10+
</head>
11+
<body>
12+
<h1>Redirecting...</h1>
13+
<a href="{{ page.redirect_to }}">Click here if you are not redirected.<a>
14+
<script>location='{{ page.redirect_to }}'</script>
15+
</body>
16+
</html>

es/overviews/core/actors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ El trait `ReplyReactor` extiende `Reactor[Any]` y sobrescribe y/o añade los sig
113113
vez se encuentre disponible; asimismo puede ser utilizada para comprobar si la respuesta
114114
está disponible sin la necesidad de bloquear el emisor. Existen dos versiones sobrecargadas.
115115
La versión que acepta dos parámetros recibe un argumento adicional de tipo
116-
`PartialFuntion[Any, A]`. Esta función parcial es utilizada para realizar el post-procesado de
116+
`PartialFunction[Any, A]`. Esta función parcial es utilizada para realizar el post-procesado de
117117
la respuesta del receptor. Básicamente, `!!` retorna un "future" que aplicará la anterior
118118
función parcial a la repuesta (una vez recibida). El resultado del "future" es el resultado
119119
de este post-procesado.

es/overviews/parallel-collections/custom-parallel-collections.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ string by appending all the string builders together. This way, elements are
151151
copied only once at the end instead of being copied every time `combine` is
152152
called. Ideally, we would like to parallelize this process and copy them in
153153
parallel (this is being done for parallel arrays), but without tapping into
154-
the internal represenation of strings this is the best we can do-- we have to
154+
the internal representation of strings this is the best we can do-- we have to
155155
live with this sequential bottleneck.
156156

157157
private class ParStringCombiner extends Combiner[Char, ParString] {
@@ -206,7 +206,7 @@ ropes and various heaps are particularly suitable for such an approach.
206206
parallel hash tables, it assumes the elements can be efficiently
207207
partially sorted into concatenable buckets from which the final
208208
data-structure can be constructed in parallel. In the first phase
209-
different procesors populate these buckets independently and
209+
different processors populate these buckets independently and
210210
concatenate the buckets together. In the second phase, the data
211211
structure is allocated and different processors populate different
212212
parts of the datastructure in parallel using elements from disjoint

ja/overviews/collections/concrete-immutable-collection-classes.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,16 +134,14 @@ first in first out) だ。
134134
範囲 ([`Range`](http://www.scala-lang.org/api/{{ site.scala-version }}/scala/collection/immutable/Range.html)) は順序付けされた等間隔の整数の列だ。例えば、「1、2、3」は範囲であり、「5、8、11、14」も範囲だ。Scala で範囲を作成するには、予め定義された `to` メソッドと `by` メソッドを使う。
135135

136136
scala> 1 to 3
137-
res2: scala.collection.immutable.Range.Inclusive
138-
with scala.collection.immutable.Range.ByOne = Range(1, 2, 3)
137+
res2: scala.collection.immutable.Range.Inclusive = Range(1, 2, 3)
139138
scala> 5 to 14 by 3
140139
res3: scala.collection.immutable.Range = Range(5, 8, 11, 14)
141140

142141
上限を含まない範囲を作成したい場合は、`to` の代わりに、便宜上用意された `until` メソッドを使う:
143142

144143
scala> 1 until 3
145-
res2: scala.collection.immutable.Range.Inclusive
146-
with scala.collection.immutable.Range.ByOne = Range(1, 2)
144+
res2: scala.collection.immutable.Range = Range(1, 2)
147145

148146
範囲は、開始値、終了値、ステップ値という、たった三つの数で定義できため定数空間で表すことができる。そのため、範囲の多くの演算は非常に高速だ。
149147

ja/overviews/macros/blackbox-whitebox.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ blackbox マクロと whitebox マクロの両方とも大切なことは認識
4343

4444
## 区別の成文化
4545

46-
まずは 2.11 リリースにおいて、def マクロのシグネチャにおいて blackbox マクロと whitebox マクロを区別して、マクロによって `scalac` が振る舞いを変えられることにすることで標準化への初手とする。これは準備段階の一手で、blackbox も witebox も Scala 2.11 では実験的機能扱いのままだ。
46+
まずは 2.11 リリースにおいて、def マクロのシグネチャにおいて blackbox マクロと whitebox マクロを区別して、マクロによって `scalac` が振る舞いを変えられることにすることで標準化への初手とする。これは準備段階の一手で、blackbox も whitebox も Scala 2.11 では実験的機能扱いのままだ。
4747

4848
この区別は `scala.reflect.macros.Context``scala.reflect.macros.blackbox.Context``scala.reflect.macros.whitebox.Context` によって置き換えることで表現する。もしマクロの実装が第一引数として `blackbox.Context` を受け取る定義ならば、それを使う def マクロは blackbox となり、 `whitebox.Context` の方も同様となる。当然のことながら互換性のために素の `Context` も方も存在し続けることになるけども、廃止勧告を出すことで blackbox か whitebox かを選ぶことを推奨していく方向となる。
4949

ko/tutorials/scala-for-java-programmers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,6 @@ Scala는 이 문제를 해결하기 위한 제네릭 클래스와 제네릭 함
677677

678678
우리는 지금까지 Scala 언어의 간략한 소개와 몇가지의 예제를 살펴
679679
보았다. 흥미가 생겼다면 *Scala By Example*도 함께 읽어보자. 더 수준
680-
높고 다양한 예제를 만날 수 있다. 필요 할 때마다 *Scala Langauge
680+
높고 다양한 예제를 만날 수 있다. 필요 할 때마다 *Scala Language
681681
Specification*을 참고하는 것도 좋다.
682682

overviews/collections/arrays.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ The `ArrayOps` object gets inserted automatically by the implicit conversion. So
6060

6161
where `intArrayOps` is the implicit conversion that was inserted previously. This raises the question how the compiler picked `intArrayOps` over the other implicit conversion to `WrappedArray` in the line above. After all, both conversions map an array to a type that supports a reverse method, which is what the input specified. The answer to that question is that the two implicit conversions are prioritized. The `ArrayOps` conversion has a higher priority than the `WrappedArray` conversion. The first is defined in the `Predef` object whereas the second is defined in a class `scala.LowPriorityImplicits`, which is inherited from `Predef`. Implicits in subclasses and subobjects take precedence over implicits in base classes. So if both conversions are applicable, the one in `Predef` is chosen. A very similar scheme works for strings.
6262

63-
So now you know how arrays can be compatible with sequences and how they can support all sequence operations. What about genericity? In Java you cannot write a `T[]` where `T` is a type parameter. How then is Scala's `Array[T]` represented? In fact a generic array like `Array[T]` could be at run-time any of Java's eight primitive array types `byte[]`, `short[]`, `char[]`, `int[]`, `long[]`, `float[]`, `double[]`, `boolean[]`, or it could be an array of objects. The only common run-time type encompassing all of these types is `AnyRef` (or, equivalently `java.lang.Object`), so that's the type to which the Scala compiler maps `Array[T]`. At run-time, when an element of an array of type `Array[T]` is accessed or updated there is a sequence of type tests that determine the actual array type, followed by the correct array operation on the Java array. These type tests slow down array operations somewhat. You can expect accesses to generic arrays to be three to four times slower than accesses to primitive or object arrays. This means that if you need maximal performance, you should prefer concrete over generic arrays. Representing the generic array type is not enough, however, There must also be a way to create generic arrays. This is an even harder problem, which requires a little bit of help from you. To illustrate the problem, consider the following attempt to write a generic method that creates an array.
63+
So now you know how arrays can be compatible with sequences and how they can support all sequence operations. What about genericity? In Java you cannot write a `T[]` where `T` is a type parameter. How then is Scala's `Array[T]` represented? In fact a generic array like `Array[T]` could be at run-time any of Java's eight primitive array types `byte[]`, `short[]`, `char[]`, `int[]`, `long[]`, `float[]`, `double[]`, `boolean[]`, or it could be an array of objects. The only common run-time type encompassing all of these types is `AnyRef` (or, equivalently `java.lang.Object`), so that's the type to which the Scala compiler maps `Array[T]`. At run-time, when an element of an array of type `Array[T]` is accessed or updated there is a sequence of type tests that determine the actual array type, followed by the correct array operation on the Java array. These type tests slow down array operations somewhat. You can expect accesses to generic arrays to be three to four times slower than accesses to primitive or object arrays. This means that if you need maximal performance, you should prefer concrete over generic arrays. Representing the generic array type is not enough, however, there must also be a way to create generic arrays. This is an even harder problem, which requires a little bit of help from you. To illustrate the problem, consider the following attempt to write a generic method that creates an array.
6464

6565
// this is wrong!
6666
def evenElems[T](xs: Vector[T]): Array[T] = {
@@ -115,4 +115,3 @@ What happened here is that the `evenElems` demands a class manifest for the type
115115
This example also shows that the context bound in the definition of `U` is just a shorthand for an implicit parameter named here `evidence$1` of type `ClassManifest[U]`.
116116

117117
In summary, generic array creation demands class manifests. So whenever creating an array of a type parameter `T`, you also need to provide an implicit class manifest for `T`. The easiest way to do this is to declare the type parameter with a `ClassManifest` context bound, as in `[T: ClassManifest]`.
118-

overviews/collections/concrete-immutable-collection-classes.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,16 +133,14 @@ Note that `dequeue` returns a pair consisting of the element removed and the res
133133
A [Range](http://www.scala-lang.org/api/{{ site.scala-version }}/scala/collection/immutable/Range.html) is an ordered sequence of integers that are equally spaced apart. For example, "1, 2, 3," is a range, as is "5, 8, 11, 14." To create a range in Scala, use the predefined methods `to` and `by`.
134134

135135
scala> 1 to 3
136-
res2: scala.collection.immutable.Range.Inclusive
137-
with scala.collection.immutable.Range.ByOne = Range(1, 2, 3)
136+
res2: scala.collection.immutable.Range.Inclusive = Range(1, 2, 3)
138137
scala> 5 to 14 by 3
139138
res3: scala.collection.immutable.Range = Range(5, 8, 11, 14)
140139

141140
If you want to create a range that is exclusive of its upper limit, then use the convenience method `until` instead of `to`:
142141

143142
scala> 1 until 3
144-
res2: scala.collection.immutable.Range.Inclusive
145-
with scala.collection.immutable.Range.ByOne = Range(1, 2)
143+
res2: scala.collection.immutable.Range = Range(1, 2)
146144

147145
Ranges are represented in constant space, because they can be defined by just three numbers: their start, their end, and the stepping value. Because of this representation, most operations on ranges are extremely fast.
148146

overviews/collections/creating-collections-from-scratch.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ You have syntax `List(1, 2, 3)` to create a list of three integers and `Map('A'
2424

2525
List.apply(1.0, 2.0)
2626

27-
So this is a call to the `apply` method of the companion object of the `List` class. That method takes an arbitrary number of arguments an constructs a list from them. Every collection class in the Scala library has a companion object with such an `apply` method. It does not matter whether the collection class represents a concrete implementation, like `List`, or `Stream` or `Vector`, do, or whether it is an abstract base class such as `Seq`, `Set` or `Traversable`. In the latter case, calling apply will produce some default implementation of the abstract base class. Examples:
27+
So this is a call to the `apply` method of the companion object of the `List` class. That method takes an arbitrary number of arguments and constructs a list from them. Every collection class in the Scala library has a companion object with such an `apply` method. It does not matter whether the collection class represents a concrete implementation, like `List`, or `Stream` or `Vector`, do, or whether it is an abstract base class such as `Seq`, `Set` or `Traversable`. In the latter case, calling apply will produce some default implementation of the abstract base class. Examples:
2828

2929
scala> List(1, 2, 3)
3030
res17: List[Int] = List(1, 2, 3)
@@ -55,4 +55,4 @@ Descendants of `Seq` classes provide also other factory operations in their comp
5555
| `S.tabulate(m, n){f}` | A sequence of sequences of dimension `m×n` where the element at each index `(i, j)` is computed by `f(i, j)`. (exists also in higher dimensions). |
5656
| `S.range(start, end)` | The sequence of integers `start` ... `end-1`. |
5757
| `S.range(start, end, step)`| The sequence of integers starting with `start` and progressing by `step` increments up to, and excluding, the `end` value. |
58-
| `S.iterate(x, n)(f)` | The sequence of length `n` with elements `x`, `f(x)`, `f(f(x))`, ... |
58+
| `S.iterate(x, n)(f)` | The sequence of length `n` with elements `x`, `f(x)`, `f(f(x))`, ... |

0 commit comments

Comments
 (0)