8000 added a little korean document to test · nectarine/scala.github.com@bc076cd · GitHub
[go: up one dir, main page]

Skip to content

Commit bc076cd

Browse files
committed
added a little korean document to test
1 parent b2abe34 commit bc076cd

File tree

4 files changed

+108
-2
lines changed

4 files changed

+108
-2
lines changed
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
---
2+
layout: overview-large
3+
title: 컬렉션 소개
4+
5+
disqus: true
6+
7+
partof: collections
8+
num: 1
9+
language: ja
10+
---
11+
12+
**Martin Odersky와 Lex Spoon**
13+
14+
대부분의 사람들에게 있어 스칼라 2.8의 가장 중요한 변화는 새 컬렉션 프레임워크일 것이다.
15+
스칼라에는 예전부터 컬렉션이 포함되어 있었다(실제 새 프레임워크도 이전 컬렉션과 상당부분 호환성이 있다).
16+
하지만 다양한 컬렉션 유형을 포괄하는 일반적이면서 균일한 프레임워크를 제공하는 것은 스칼라 2.8 부터이다.
17+
18+
Even though the additions to collections are subtle at first glance,
19+
the changes they can provoke in your programming style can be
20+
profound. In fact, quite often it's as if you work on a higher-level
21+
with the basic building blocks of a program being whole collections
22+
instead of their elements. This new style of programming requires some
23+
adaptation. Fortunately, the adaptation is helped by several nice
24+
properties of the new Scala collections. They are easy to use,
25+
concise, safe, fast, universal.
26+
27+
**Easy to use:** A small vocabulary of 20-50 methods is
28+
enough to solve most collection problems in a couple of operations. No
29+
need to wrap your head around complicated looping structures or
30+
recursions. Persistent collections and side-effect-free operations mean
31+
that you need not worry about accidentally corrupting existing
32+
collections with new data. Interference between iterators and
33+
collection updates is eliminated.
34+
35+
**Concise:** You can achieve with a single word what used to
36+
take one or several loops. You can express functional operations with
37+
lightweight syntax and combine operations effortlessly, so that the result
38+
feels like a custom algebra.
39+
40+
**Safe:** This one has to be experienced to sink in. The
41+
statically typed and functional nature of Scala's collections means
42+
that the overwhelming majority of errors you might make are caught at
43+
compile-time. The reason is that (1) the collection operations
44+
themselves are heavily used and therefore well
45+
tested. (2) the usages of the collection operation make inputs and
46+
output explicit as function parameters and results. (3) These explicit
47+
inputs and outputs are subject to static type checking. The bottom line
48+
is that the large majority of misuses will manifest themselves as type
49+
errors. It's not at all uncommon to have programs of several hundred
50+
lines run at first try.
51+
52+
**Fast:** Collection operations are tuned and optimized in the
53+
libraries. As a result, using collections is typically quite
54+
efficient. You might be able to do a little bit better with carefully
55+
hand-tuned data structures and operations, but you might also do a lot
56+
worse by making some suboptimal implementation decisions along the
57+
way. What's more, collections have been recently adapted to parallel
58+
execution on multi-cores. Parallel collections support the same
59+
operations as sequential ones, so no new operations need to be learned
60+
and no code needs to be rewritten. You can turn a sequential collection into a
61+
parallel one simply by invoking the `par` method.
62+
63+
**Universal:** Collections provide the same operations on
64+
any type where it makes sense to do so. So you can achieve a lot with
65+
a fairly small vocabulary of operations. For instance, a string is
66+
conceptually a sequence of characters. Consequently, in Scala
67+
collections, strings support all sequence operations. The same holds
68+
for arrays.
69+
70+
**Example:** Here's one line of code that demonstrates many of the
71+
advantages of Scala's collections.
72+
73+
val (minors, adults) = people partition (_.age < 18)
74+
75+
It's immediately clear what this operation does: It partitions a
76+
collection of `people` into `minors` and `adults` depending on
77+
their age. Because the `partition` method is defined in the root
78+
collection type `TraversableLike`, this code works for any kind of
79+
collection, including arrays. The resulting `minors` and `adults`
80+
collections will be of the same type as the `people` collection.
81+
82+
This code is much more concise than the one to three loops required for
83+
traditional collection processing (three loops for an array, because
84+
the intermediate results need to be buffered somewhere else). Once
85+
you have learned the basic collection vocabulary you will also find
86+
writing this code is much easier and safer than writing explicit
87+
loops. Furthermore, the `partition` operation is quite fast, and will
88+
get even faster on parallel collections on multi-cores. (Parallel
89+
collections have been released
90+
as part of Scala 2.9.)
91+
92+
This document provides an in depth discussion of the APIs of the
93+
Scala collections classes from a user perspective. They take you on
94+
a tour of all the fundamental classes and the methods they define.

ko/overviews/index.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
layout: guides-index
3+
language: ko
4+
title: 가이드 및 개요
5+
---
6+
7+
<div class="page-header-index">
8+
<h1>핵심 <small>필수요소들...</small></h1>
9+
</div>
10+
11+
{% include localized-overview-index.txt %}
12+
<!--* Swing <span class="label important">공사중...</span>-->

overviews/collections/introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ disqus: true
66

77
partof: collections
88
num: 1
9-
languages: [ja]
9+
languages: [ja, ko]
1010
---
1111

1212
**Martin Odersky, and Lex Spoon**

overviews/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
layout: guides-index
33
title: Guides and Overviews
4-
languages: [es, ja]
4+
languages: [es, ja, ko]
55
---
66

77
<div class="page-header-index">

0 commit comments

Comments
 (0)
0