Skip to content

Commit 1febc3f

Browse files
committed
Fix conflicts
2 parents 04a52b7 + ba6c744 commit 1febc3f

File tree

7 files changed

+6
-7
lines changed

7 files changed

+6
-7
lines changed

CNAME

Lines changed: 0 additions & 1 deletion
This file was deleted.

_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ collections:
2222
scala-version: 2.12.2
2323

2424
highlighter: rouge
25-
permalink: /:categories/:title.html
25+
permalink: /:categories/:title.html:output_ext
2626
baseurl:
2727
exclude: ["vendor"]
2828
gems:

ja/overviews/reflection/typetags-manifests.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,6 @@ context bound `[T: TypeTag]` からコンパイラは `TypeTag[T]`
149149
代わりに、(クラスの場合は) Java か (型の場合は) Scala によって提供されるリフレクション API を使うことができる。</li>
150150
</ul>
151151

152-
`scala.reflect.ClassManifests` は Scala 2.10 から廃止予定となり、将来のマイナーリリースにおいて
152+
`scala.reflect.ClassManifest` は Scala 2.10 から廃止予定となり、将来のマイナーリリースにおいて
153153
`scala.reflect.Manifest` も廃止予定として `TypeTag``ClassTag` に道を開けることを予定している。
154154
そのため、マニフェストを使ったコードは型タグを使うものに移行することを推奨する。

overviews/reflection/typetags-manifests.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ Instead, one could generate corresponding types using the reflection APIs provid
156156
- **Certain manifest operations(i.e., `<:<`, `>:>` and `typeArguments`) are not supported.**
157157
Instead, one could use the reflection APIs provided by Java (for classes) and Scala (for types).
158158

159-
In Scala 2.10, `scala.reflect.ClassManifests` are deprecated, and it is
159+
In Scala 2.10, `scala.reflect.ClassManifest` are deprecated, and it is
160160
planned to deprecate `scala.reflect.Manifest` in favor of `TypeTag`s and
161161
`ClassTag`s in an upcoming point release. Thus, it is advisable to migrate any
162162
`Manifest`-based APIs to use `Tag`s.

tutorials/tour/_posts/2017-02-13-polymorphic-methods.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ println(listOfDuplicates[Int](3, 4)) // List(3, 3, 3, 3)
2929
println(listOfDuplicates("La", 8)) // List(La, La, La, La, La, La, La, La)
3030
```
3131

32-
The method `listOfDuplicates` takes a type parameter `A` and values parameters `x` and `n`. In this case, value `x` is of type `A`. If `length < 1` we return an empty list. Otherwise we prepend `x` to the the list of duplicates returned by the recursive call to `listOfDuplicates`. (note: `::` means prepend an element on the left to a sequence on the right).
32+
The method `listOfDuplicates` takes a type parameter `A` and values parameters `x` and `length`. In this case, value `x` is of type `A`. If `length < 1` we return an empty list. Otherwise we prepend `x` to the the list of duplicates returned by the recursive call to `listOfDuplicates`. (note: `::` means prepend an element on the left to a sequence on the right).
3333

3434
When we call `listOfDuplicates` with `[Int]` as the type parameter, the first argument must be an int and the return type will be List[Int]. However, you don't always need to explicitly provide the the type parameter because the compiler can often figure it out based on the type of value argument (`"La"` is a String). In fact, if calling this method from Java it is impossible to provide the type parameter.

tutorials/tour/_posts/2017-02-13-unified-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ In Scala, all values have a type, including numerical values and functions. The
2222

2323
`AnyVal` represents value types. There are nine predefined value types and they are non-nullable: `Double`, `Float`, `Long`, `Int`, `Short`, `Byte`, `Char`, `Unit`, and `Boolean`. `Unit` is a value type which carries no meaningful information. There is exactly one instance of `Unit` which can be declared literally like so: `()`. All functions must return something so sometimes `Unit` is a useful return type.
2424

25-
`AnyRef` represents reference types. All non-value types are defined as reference types. Anywhere an `AnyRef` Every user-defined type in Scala is a subtype of `AnyRef`. If Scala is used in the context of a Java runtime environment, `AnyRef` corresponds to `java.lang.Object`.
25+
`AnyRef` represents reference types. All non-value types are defined as reference types. Every user-defined type in Scala is a subtype of `AnyRef`. If Scala is used in the context of a Java runtime environment, `AnyRef` corresponds to `java.lang.Object`.
2626

2727
Here is an example that demonstrates that strings, integers, characters, boolean values, and functions are all objects just like every other object:
2828

zh-cn/overviews/collections/arrays.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ ArrayOps的对象会通过隐式转换自动的插入,因此上述的代码等
5858
scala> intArrayOps(a1).reverse
5959
res5: Array[Int] = Array(3, 2, 1)
6060

61-
这里的intArrayOps就是之前例子中插入的隐式转换。这里引出一个疑问,上面代码中,编译器为何选择了intArrayOps而不是WrappedArray做隐式转换?毕竟,两种转换都是将数组映射到支持reverse方法的类型,并且指定输入。答案是两种转换是有优先级次序的,ArrayOps转换比WrappedArray有更高的优先级。前者定义在Predef对象中,而后者定义在继承自Predef的`scala.LowPriorityImplicits`类中。子类、子对象中隐式转换的优先级低于基类。所以如果两种转换都可用,Predef中的会优先选取。字符串的情况也是如此。
61+
这里的intArrayOps就是之前例子中插入的隐式转换。这里引出一个疑问,上面代码中,编译器为何选择了intArrayOps而不是WrappedArray做隐式转换?毕竟,两种转换都是将数组映射到支持reverse方法的类型,并且指定输入。答案是两种转换是有优先级次序的,ArrayOps转换比WrappedArray有更高的优先级。前者定义在Predef对象中,而后者定义在Predef的基类 `scala.LowPriorityImplicits`。子类、子对象中隐式转换的优先级高于基类。所以如果两种转换都可用,Predef中的会优先选取。字符串的情况也是如此。
6262

6363
数组与序列兼容,并支持所有序列操作的方法,你现在应该已经了然于胸。那泛型呢?在Java中你不可以定义一个以T为类型参数的`T[]`。那么Scala的`Array[T]`是如何做的呢?事实上一个像`Array[T] `的泛型数组在运行时态可任意为Java的八个原始数组类型像`byte[]`, `short[]`, `char[]`, `int[]`, `long[]`, `float[]`, `double[]`, `boolean[]`,甚至它可以是一个对象数组。最常见的运行时态类型是AnyRef ,它包括了所有的这些类型(相当于java.lang.Object),因此这样的类型可以通过Scala编译器映射到`Array[T]`.在运行时,当`Array[T]`类型的数组元素被访问或更新时,就会有一个序列的类型测试用于确定真正的数组类型,随后就是java中的正确的数组操作。这些类型测试会影响数组操作的效率。这意味着如果你需要更大的性能,你应该更喜欢具体而明确的泛型数组。代表通用的泛型数组是不够的,因此,也必然有一种方式去创造泛型数组。这是一个更难的问题,需要一点点的帮助你。为了说明这个问题,考虑下面用一个通用的方法去创造数组的尝试。
6464

0 commit comments

Comments
 (0)