https://trans.onionmixer.net/mediawiki/index.php?title=SqueakByExample:9.2&feed=atom&action=history
SqueakByExample:9.2 - Revision history
2024-03-28T16:12:17Z
Revision history for this page on the wiki
MediaWiki 1.38.1
https://trans.onionmixer.net/mediawiki/index.php?title=SqueakByExample:9.2&diff=2080&oldid=prev
Onionmixer: 용어수정
2013-09-16T19:33:51Z
<p>용어수정</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 19:33, 16 September 2013</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l3">Line 3:</td>
<td colspan="2" class="diff-lineno">Line 3:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>컬렉션 클래스를 보다 잘 사용하기 위해, 사용자는 적어도 컬렉션 클래스들의 외형 및 컬렉션 클래스들의 공통점들과 차이점들에 대한 지식을 알고 있는것이 좋습니다. </div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>컬렉션 클래스를 보다 잘 사용하기 위해, 사용자는 적어도 컬렉션 클래스들의 외형 및 컬렉션 클래스들의 공통점들과 차이점들에 대한 지식을 알고 있는것이 좋습니다. </div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>각각의 구성요소들보다는, 컬렉션들을 사용하여 프로그래밍을 하는 것이 프로그램의 추상성의 수준을 끌어올릴 수 있는 보다 중요한 방법입니다. Lisp 언어의 map 함수는 함수와 목록을 <del style="font-weight: bold; text-decoration: none;">인수로 </del>받아서 목록의 각 요소에 각각 함수를 적용해서 결과를 목록으로 반환하며, Smalltalk-80 은 핵심원리로 (이런스타일을 따라) 컬렉션 기반 프로그래밍을 채택하였으며, ML 과 Haskell 과 같은 현대 함수기반 프로그래밍 언어들은 스몰토크의 스타일를 따랐다고 할 수 있습니다.</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>각각의 구성요소들보다는, 컬렉션들을 사용하여 프로그래밍을 하는 것이 프로그램의 추상성의 수준을 끌어올릴 수 있는 보다 중요한 방법입니다. Lisp 언어의 map 함수는 함수와 목록을 <ins style="font-weight: bold; text-decoration: none;">인자로 </ins>받아서 목록의 각 요소에 각각 함수를 적용해서 결과를 목록으로 반환하며, Smalltalk-80 은 핵심원리로 (이런스타일을 따라) 컬렉션 기반 프로그래밍을 채택하였으며, ML 과 Haskell 과 같은 현대 함수기반 프로그래밍 언어들은 스몰토크의 스타일를 따랐다고 할 수 있습니다.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>왜 이런것이 좋은 아이디어 일까요? 예를 들면 학생에 대한 레코드의 집합인 데이터 구조가 있고, 몇가지 기준에 부합하는 모든 학생의 레코드에 대해 같은 동작을 진행하기 원한다고 하죠. 기존의 언어를 사용하는 프로그래머라면 반복문을 바로 생각하겠지만, 스몰토크 프로그래머는 다음처럼 표현식 을 작성할 것입니다.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>왜 이런것이 좋은 아이디어 일까요? 예를 들면 학생에 대한 레코드의 집합인 데이터 구조가 있고, 몇가지 기준에 부합하는 모든 학생의 레코드에 대해 같은 동작을 진행하기 원한다고 하죠. 기존의 언어를 사용하는 프로그래머라면 반복문을 바로 생각하겠지만, 스몰토크 프로그래머는 다음처럼 표현식 을 작성할 것입니다.</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l53">Line 53:</td>
<td colspan="2" class="diff-lineno">Line 53:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* '''수정가능(Mutable)''': 대부분의 컬렉션들은 변경이 가능하지만, Intervals 와 Symbols 는 그렇지 않습니다. Interval 은 정수의 범위를 나타내는 컬렉션으로서 수정이 불가능합니다. 예를 들어 5 to: 16 by: 2 는 5, 7, 9, 11, 13 과 15 라는 구성요소를 포함하고 있는 Interval 이 됩니다. 이런것들(Interval 또는 Symbols)은 at: 을 사용하면 색인이 가능하지만, at:put: 을 사용해서 값을 변경할 수는 없습니다.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* '''수정가능(Mutable)''': 대부분의 컬렉션들은 변경이 가능하지만, Intervals 와 Symbols 는 그렇지 않습니다. Interval 은 정수의 범위를 나타내는 컬렉션으로서 수정이 불가능합니다. 예를 들어 5 to: 16 by: 2 는 5, 7, 9, 11, 13 과 15 라는 구성요소를 포함하고 있는 Interval 이 됩니다. 이런것들(Interval 또는 Symbols)은 at: 을 사용하면 색인이 가능하지만, at:put: 을 사용해서 값을 변경할 수는 없습니다.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* '''성장가능(Growable)''': Interval 이나 Array 의 인스턴스는 항상 고정된 크기를 가지게 됩니다. 다른 종류의 컬렉션(sorted collection, ordered collection, 그리고 linked list)은 일단 생성된 이후에 크기가 커질 수 있습니다. OrderedCollection 클래스는 배열보다 범용적이며, OrderedCollection 은 동적으로 크기가 커질 수 있고, at: 과 at:put: 은 물론이고 더 쓸모있는 addFirst: 와 addLast: 등의 메서드도 가지고 있습니다.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* '''성장가능(Growable)''': Interval 이나 Array 의 인스턴스는 항상 고정된 크기를 가지게 됩니다. 다른 종류의 컬렉션(sorted collection, ordered collection, 그리고 linked list)은 일단 생성된 이후에 크기가 커질 수 있습니다. OrderedCollection 클래스는 배열보다 범용적이며, OrderedCollection 은 동적으로 크기가 커질 수 있고, at: 과 at:put: 은 물론이고 더 쓸모있는 addFirst: 와 addLast: 등의 메서드도 가지고 있습니다.</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>* '''중복 허용(Accepts duplicates)''': Set 컬렉션은 중복된 요소를 걸러내지만, Bag 은 그런작업을 하지는 않습니다. Dictionary, Set 그리고 Bag 은 요소의 중복을 판단할때 각 요소에서 제공되는 =(equal) 메서드를 사용합니다; 이런 클래스의 Identity 등과 같은 변종은 두개의 <del style="font-weight: bold; text-decoration: none;">인수</del>(파라메터)가 같은 객체인가를 테스트하는 ==(double equal) 을 사용하며, Pluggable 같은 변종은 컬렉션의 생성시에 주어진 임의의 동치관계(메서드)를 사용합니다.</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* '''중복 허용(Accepts duplicates)''': Set 컬렉션은 중복된 요소를 걸러내지만, Bag 은 그런작업을 하지는 않습니다. Dictionary, Set 그리고 Bag 은 요소의 중복을 판단할때 각 요소에서 제공되는 =(equal) 메서드를 사용합니다; 이런 클래스의 Identity 등과 같은 변종은 두개의 <ins style="font-weight: bold; text-decoration: none;">인자</ins>(파라메터)가 같은 객체인가를 테스트하는 ==(double equal) 을 사용하며, Pluggable 같은 변종은 컬렉션의 생성시에 주어진 임의의 동치관계(메서드)를 사용합니다.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* '''혼합가능(Heterogeneous)''': 대부분의 컬렉션들은 요소가 어떤 종류라 하더라도 수용이 가능합니다. 하지만, String, CharacterArray 또는 Symbol 은 Chracter 만을 수용할 수 있습니다. Array 는 여러가지 객체를 수용할 수 있지만, ByteArray 는 오직 Bytes 만 수용하며, IntergerArray 는 오직 Integer 를 수용하고, FloatArray 는 오직 Floats 만을 수용합니다. LinkedList 는 Link ▷ accessing protocol 을 준수하는 요소만 수용가능한 제약을 가집니다..</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* '''혼합가능(Heterogeneous)''': 대부분의 컬렉션들은 요소가 어떤 종류라 하더라도 수용이 가능합니다. 하지만, String, CharacterArray 또는 Symbol 은 Chracter 만을 수용할 수 있습니다. Array 는 여러가지 객체를 수용할 수 있지만, ByteArray 는 오직 Bytes 만 수용하며, IntergerArray 는 오직 Integer 를 수용하고, FloatArray 는 오직 Floats 만을 수용합니다. LinkedList 는 Link ▷ accessing protocol 을 준수하는 요소만 수용가능한 제약을 가집니다..</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
</table>
Onionmixer
https://trans.onionmixer.net/mediawiki/index.php?title=SqueakByExample:9.2&diff=2079&oldid=prev
Onionmixer: 번역수정
2013-09-08T14:57:38Z
<p>번역수정</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 14:57, 8 September 2013</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l12">Line 12:</td>
<td colspan="2" class="diff-lineno">Line 12:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>위의 표현식은 대괄호 안의 함수가 '''true'''<ref name="주석9-2">대괄호에 있는 표현식은 익명의 함수 '''_x.x gpa < threshold''' 를 정의하는 표현식으로서 간주될 수 있습니다.</ref> 를 반환할때 students 의 element 를 포함하는 새 컬렉션으로 평가(evaluates)합니다. 스몰토크 코드는 도메인-특화 조회 언어의 단순성과 우아함을 갖고 있습니다. </div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>위의 표현식은 대괄호 안의 함수가 '''true'''<ref name="주석9-2">대괄호에 있는 표현식은 익명의 함수 '''_x.x gpa < threshold''' 를 정의하는 표현식으로서 간주될 수 있습니다.</ref> 를 반환할때 students 의 element 를 포함하는 새 컬렉션으로 평가(evaluates)합니다. 스몰토크 코드는 도메인-특화 조회 언어의 단순성과 우아함을 갖고 있습니다.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l21">Line 21:</td>
<td colspan="2" class="diff-lineno">Line 21:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>!Protocol||Methods</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>!Protocol||Methods</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|-</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|-</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>|accessing||size, capacity, at: anIndex , at: anIndex put: anElement</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>|accessing||size, capacity, at: anIndex, at: anIndex put: anElement</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|-</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|-</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>|testing||isEmpty, includes: anElement , contains: aBlock ,occurrencesOf: anElement</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>|testing||isEmpty, includes: anElement, contains: aBlock, occurrencesOf: anElement</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|-</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|-</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>|adding||add: anElement , addAll: aCollection</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>|adding||add: anElement, addAll: aCollection</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|-</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|-</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>|removing||remove: anElement , remove: anElement ifAbsent: aBlock ,removeAll: aCollection</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>|removing||remove: anElement, remove: anElement ifAbsent: aBlock, removeAll: aCollection</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|-</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|-</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>|enumerating||do: aBlock , collect: aBlock , select: aBlock , reject: aBlock ,detect: aBlock , detect: aBlock ifNone: aNoneBlock ,inject: aValue into: aBinaryBlock</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>|enumerating||do: aBlock, collect: aBlock, select: aBlock, reject: aBlock, detect: aBlock, detect: aBlock ifNone: aNoneBlock, inject: aValue into: aBinaryBlock</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|-</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|-</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|converting||asBag, asSet, asOrderedCollection, asSortedCollection,asArray, asSortedCollection: aBlock</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|converting||asBag, asSet, asOrderedCollection, asSortedCollection,asArray, asSortedCollection: aBlock</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|-</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|-</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>|creation||with: anElement , with:with:, with:with:with:,with:with:with:with:, withAll: aCollection</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>|creation||with: anElement, with:with:, with:with:with:, with:with:with:with:, withAll: aCollection</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|}</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|}</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>메시지 select: 는 스몰토크의 모든 컬렉션에 전달될 수 있습니다. students 의 데이터 구조가 배열 또는 linked list 인지를 확인할 필요는 없습니다: select: 메시지는 양쪽 모두에 전달될 수 있습니다. 반복(loop)를 사용하는경우에는 students 가 배열인지 linked list 인지를 미리 알아두어야 합니다만, 반복과는 다르다는것에 주의해주시기 바랍니다. 스몰토크에서, 특정 컬렉션을 지칭하지않고 그냥 '''컬렉션''' 이라고만 하는 경우는, element 가 대상이 되는 객체에 들어있는지를 테스트하고 열거하기위한 잘 정의된 프로토콜을 지원하는 객체를 의미합니다<ref name="참고1">c++의 경우는 iterator 가 이와 비슷합니다.</ref>. 모든 스몰토크의 컬렉션은 isEmpty 와 occurrencesOf: 을 포함한 테스팅 메시지를 사용할 수 있습니다. 또한 모든 컬렉션은 열거 메시지 do:,select:, reject: (select: 의 반대되는 것), collect:(Lisp 의 map 과 같은), detect:ifNone:, inject:into: (왼쪽 fold를 수행하는)과 더 많은 메시지를 사용할 수 있습니다. 이런 프로토콜의 범용성과 다양성은 컬렉션을 강력하게 만들어주는 특징입니다.</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>메시지 select: 는 스몰토크의 모든 컬렉션에 전달될 수 있습니다. students 의 데이터 구조가 배열 또는 linked list 인지를 확인할 필요는 없습니다: select: 메시지는 양쪽 모두에 전달될 수 있습니다. 반복(loop)를 사용하는경우에는 students 가 배열인지 linked list 인지를 미리 알아두어야 합니다만, 반복과는 다르다는것에 주의해주시기 바랍니다. 스몰토크에서, 특정 컬렉션을 지칭하지않고 그냥 '''컬렉션''' 이라고만 하는 경우는, element 가 대상이 되는 객체에 들어있는지를 테스트하고 열거하기위한 잘 정의된 프로토콜을 지원하는 객체를 의미합니다<ref name="참고1">c++의 경우는 iterator 가 이와 비슷합니다.</ref>. 모든 스몰토크의 컬렉션은 isEmpty 와 occurrencesOf: 을 포함한 테스팅 메시지를 사용할 수 있습니다. 또한 모든 컬렉션은 열거 메시지 do:, select:, reject: (select: 의 반대되는 것), collect:(Lisp 의 map 과 같은), detect:ifNone:, inject:into: (왼쪽 fold를 수행하는)과 더 많은 메시지를 사용할 수 있습니다. 이런 프로토콜의 범용성과 다양성은 컬렉션을 강력하게 만들어주는 특징입니다.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l46">Line 46:</td>
<td colspan="2" class="diff-lineno">Line 46:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>* '''순차가능(Sequenceable)''': <del style="font-weight: bold; text-decoration: none;">첫 번째 구성요소에서 시작하여 마지막 구성요소에 이르기까지 잘 정의된 </del>순서로 <del style="font-weight: bold; text-decoration: none;">진행되는 SequenceableCollection의 모든 서브클래스들의 인스턴스들입니다</del>. <del style="font-weight: bold; text-decoration: none;">다른 한편으로는</del>, Set, Bag <del style="font-weight: bold; text-decoration: none;">그리고 딕셔너리의 인스턴스들은 순차적으로 </del>배치할 수 없습니다.</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> </div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>* '''분류가능(Sortable)''': <del style="font-weight: bold; text-decoration: none;">SortedCollection은 분류 수서에 </del>따라 <del style="font-weight: bold; text-decoration: none;">자체의 구성요소들을 </del>유지합니다.</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* '''순차가능(Sequenceable)''': <ins style="font-weight: bold; text-decoration: none;">SequenceableCollection 의 모든 서브 클래스의 인스턴스는, first 요소로부터 시작되어, last 요소까지 명확하게 정해진 </ins>순서로 <ins style="font-weight: bold; text-decoration: none;">진행됩니다(sequenceable)</ins>. <ins style="font-weight: bold; text-decoration: none;">반대되는 경우로서</ins>, Set, Bag<ins style="font-weight: bold; text-decoration: none;">, Dictionary 의 인스턴스는 순서대로 </ins>배치할 수 없습니다.</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>* '''색인가능(Indexable)''': <del style="font-weight: bold; text-decoration: none;">가장 순차가능 컬렉션들은 또한 </del>at:<del style="font-weight: bold; text-decoration: none;">과 함께 </del>검색할 수 <del style="font-weight: bold; text-decoration: none;">있는 구성요소인 색인가능입니다</del>. <del style="font-weight: bold; text-decoration: none;">배열은 </del>고정된 크기를 가진 친숙한 indexable 데이터 구조이며 anArray at: <del style="font-weight: bold; text-decoration: none;">n은 anArray의 nth 구성요소를 검색하며</del>, anArray at: n put: <del style="font-weight: bold; text-decoration: none;">v은 v에 nth 구성요소를 부과합니다</del>. LinkedLists 와 SkipLists 은 sequenceable 이지만, <del style="font-weight: bold; text-decoration: none;">indexable이 </del>아닙니다. <del style="font-weight: bold; text-decoration: none;">그 의미는 이것들은 first와 last를 이해하지만 </del>at:<del style="font-weight: bold; text-decoration: none;">은 </del>이해하지 못합니다. <del style="font-weight: bold; text-decoration: none;"> </del></div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* '''분류가능(Sortable)''': <ins style="font-weight: bold; text-decoration: none;">SortedCollection 은 해당 요소들을 정렬 순서에 </ins>따라 유지합니다.</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>* '''Keyed''': <del style="font-weight: bold; text-decoration: none;">딕셔너리의 인스턴스들이며</del>, <del style="font-weight: bold; text-decoration: none;">이것의 서브클래스들은 indices </del>대신에 <del style="font-weight: bold; text-decoration: none;">keys로 접근할 </del>수 있습니다. </div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* '''색인가능(Indexable)''': <ins style="font-weight: bold; text-decoration: none;">대부분의 sequenceable 콜렉션은 index 를 생성할 수 있으며, </ins>at: <ins style="font-weight: bold; text-decoration: none;">을 이용해서 요소를 </ins>검색할 수 <ins style="font-weight: bold; text-decoration: none;">있습니다</ins>. <ins style="font-weight: bold; text-decoration: none;">Array 는 </ins>고정된 크기를 가진 친숙한 indexable 데이터 구조이며<ins style="font-weight: bold; text-decoration: none;">, </ins>anArray at: <ins style="font-weight: bold; text-decoration: none;">n 은 anArray 의 n번째(n<sup>''th''</sup>) 요소를 검색하고</ins>, anArray at: n put: <ins style="font-weight: bold; text-decoration: none;">v 는 n번째의 요소의 값을 v 로 바꿉니다</ins>. LinkedLists 와 SkipLists 은 sequenceable 이지만, <ins style="font-weight: bold; text-decoration: none;">indexable 은 </ins>아닙니다. <ins style="font-weight: bold; text-decoration: none;">즉 first 와 last 에는 반응할 수 있습니다만, </ins>at: <ins style="font-weight: bold; text-decoration: none;">메서드는 </ins>이해하지 못합니다.</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>* '''수정가능(Mutable)'''<del style="font-weight: bold; text-decoration: none;">: Mutable</del>: 대부분의 컬렉션들은 <del style="font-weight: bold; text-decoration: none;">수정 </del>가능하지만, <del style="font-weight: bold; text-decoration: none;">인터벌과 심볼은 </del>그렇지 않습니다. <del style="font-weight: bold; text-decoration: none;">인터벌(</del>Interval<del style="font-weight: bold; text-decoration: none;">)</del>은 정수의 범위를 나타내는 <del style="font-weight: bold; text-decoration: none;">수정 불가능 컬렉션입니다</del>. 예를 <del style="font-weight: bold; text-decoration: none;">들면 </del>5 to: 16 by: 2 는 <del style="font-weight: bold; text-decoration: none;">구성요소 </del>5, 7, 9, 11, <del style="font-weight: bold; text-decoration: none;">13과 15를 </del>포함하고 있는 <del style="font-weight: bold; text-decoration: none;">인터벌입니다</del>. <del style="font-weight: bold; text-decoration: none;">이것은 </del>at:<del style="font-weight: bold; text-decoration: none;">과 함께 indexable 이지만</del>, at:put:<del style="font-weight: bold; text-decoration: none;">으로 변경될 수 </del>없습니다.</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* '''Keyed''': <ins style="font-weight: bold; text-decoration: none;">Dictionary 와 그 서브클래스의 인스턴스는</ins>, <ins style="font-weight: bold; text-decoration: none;">색인 </ins>대신에 <ins style="font-weight: bold; text-decoration: none;">키(keys) 로 참조할 </ins>수 있습니다.</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>* '''성장가능(Growable)''': <del style="font-weight: bold; text-decoration: none;">인터벌의 인스턴스들과 배열은 </del>항상 고정된 크기를 <del style="font-weight: bold; text-decoration: none;">가집니다</del>. 다른 컬렉션 <del style="font-weight: bold; text-decoration: none;">종류는 </del>(<del style="font-weight: bold; text-decoration: none;">분류된 컬렉션</del>, <del style="font-weight: bold; text-decoration: none;">순서가 정렬된 컬렉선 </del>그리고 <del style="font-weight: bold; text-decoration: none;">링크된 목록들</del>)은 <del style="font-weight: bold; text-decoration: none;">만들어진 </del>이후에 <del style="font-weight: bold; text-decoration: none;">성장할 </del>수 있습니다. <del style="font-weight: bold; text-decoration: none;">클래스 OrderedCollection은 </del>배열보다 <del style="font-weight: bold; text-decoration: none;">좀더 일반적인 것이며</del>, <del style="font-weight: bold; text-decoration: none;">OrderedCollection의 크기는 성장할 것이고</del>, <del style="font-weight: bold; text-decoration: none;">또한 그것은 </del>at:과 at:put: <del style="font-weight: bold; text-decoration: none;">뿐만 아니라 </del>addFirst:와 addLast:<del style="font-weight: bold; text-decoration: none;">를 위한 메소드를 갖고 </del>있습니다. </div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* '''수정가능(Mutable)''': 대부분의 컬렉션들은 <ins style="font-weight: bold; text-decoration: none;">변경이 </ins>가능하지만, <ins style="font-weight: bold; text-decoration: none;">Intervals 와 Symbols 는 </ins>그렇지 않습니다. Interval 은 정수의 범위를 나타내는 <ins style="font-weight: bold; text-decoration: none;">컬렉션으로서 수정이 불가능합니다</ins>. 예를 <ins style="font-weight: bold; text-decoration: none;">들어 </ins>5 to: 16 by: 2 는 5, 7, 9, 11, <ins style="font-weight: bold; text-decoration: none;">13 과 15 라는 구성요소를 </ins>포함하고 있는 <ins style="font-weight: bold; text-decoration: none;">Interval 이 됩니다</ins>. <ins style="font-weight: bold; text-decoration: none;">이런것들(Interval 또는 Symbols)은 </ins>at: <ins style="font-weight: bold; text-decoration: none;">을 사용하면 색인이 가능하지만</ins>, at:put: <ins style="font-weight: bold; text-decoration: none;">을 사용해서 값을 변경할 수는 </ins>없습니다.</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>* '''<del style="font-weight: bold; text-decoration: none;">복제물 수락</del>(Accepts duplicates)''': <del style="font-weight: bold; text-decoration: none;">Set은 복제물을 걸러내겠지만</del>, <del style="font-weight: bold; text-decoration: none;">Bag은 그렇지 않을 것입니다</del>. Dictionary, Set 그리고 <del style="font-weight: bold; text-decoration: none;">Bag은 구성요소들에 의해 제공된 </del>= <del style="font-weight: bold; text-decoration: none;">메소드를 사용하며, 이 클래스들의 </del>Identity <del style="font-weight: bold; text-decoration: none;">변수들은 인수들이 동일한 오브젝트인지를 </del>테스트하는 == <del style="font-weight: bold; text-decoration: none;">메소드를 사용하고 Puggable 변수들은 </del>컬렉션의 <del style="font-weight: bold; text-decoration: none;">생성자에 의해 공급된 임시 등가 관계를 </del>사용합니다. <del style="font-weight: bold; text-decoration: none;"> </del></div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* '''성장가능(Growable)''': <ins style="font-weight: bold; text-decoration: none;">Interval 이나 Array 의 인스턴스는 </ins>항상 고정된 크기를 <ins style="font-weight: bold; text-decoration: none;">가지게 됩니다</ins>. 다른 <ins style="font-weight: bold; text-decoration: none;">종류의 </ins>컬렉션(<ins style="font-weight: bold; text-decoration: none;">sorted collection, ordered collection</ins>, 그리고 <ins style="font-weight: bold; text-decoration: none;">linked list</ins>)은 <ins style="font-weight: bold; text-decoration: none;">일단 생성된 </ins>이후에 <ins style="font-weight: bold; text-decoration: none;">크기가 커질 </ins>수 있습니다. <ins style="font-weight: bold; text-decoration: none;">OrderedCollection 클래스는 </ins>배열보다 <ins style="font-weight: bold; text-decoration: none;">범용적이며</ins>, <ins style="font-weight: bold; text-decoration: none;">OrderedCollection 은 동적으로 크기가 커질 수 있고</ins>, at: 과 at:put: <ins style="font-weight: bold; text-decoration: none;">은 물론이고 더 쓸모있는 </ins>addFirst: 와 addLast: <ins style="font-weight: bold; text-decoration: none;">등의 메서드도 가지고 </ins>있습니다.</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>* '''<del style="font-weight: bold; text-decoration: none;">혼합</del>(Heterogeneous)''': 대부분의 컬렉션들은 <del style="font-weight: bold; text-decoration: none;">모든 구성요소들의 종류를 보유할 것입니다</del>. <del style="font-weight: bold; text-decoration: none;">그럼에도 불구하고</del>, String, CharacterArray 또는 <del style="font-weight: bold; text-decoration: none;">심볼은 오직 문자만을 보유하고 </del>있습니다. <del style="font-weight: bold; text-decoration: none;">배열은 모든 오브젝트의 혼합을 보유할 것이만</del>, <del style="font-weight: bold; text-decoration: none;">ByteArray는 </del>오직 <del style="font-weight: bold; text-decoration: none;">Bytes만을 보유하며</del>, <del style="font-weight: bold; text-decoration: none;">IntergerArray는 </del>오직 <del style="font-weight: bold; text-decoration: none;">정수들을 보유하며</del>, <del style="font-weight: bold; text-decoration: none;">FloatArray는 </del>오직 <del style="font-weight: bold; text-decoration: none;">Floats를 보유합니다</del>. <del style="font-weight: bold; text-decoration: none;"> LinkedList는 프로토콜에 </del>Link ▷ accessing <del style="font-weight: bold; text-decoration: none;">protocol에 맞는 구성요소들을 보유하기 위해 제약됩니다</del>.</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* '''<ins style="font-weight: bold; text-decoration: none;">중복 허용</ins>(Accepts duplicates)''': <ins style="font-weight: bold; text-decoration: none;">Set 컬렉션은 중복된 요소를 걸러내지만</ins>, <ins style="font-weight: bold; text-decoration: none;">Bag 은 그런작업을 하지는 않습니다</ins>. Dictionary, Set 그리고 <ins style="font-weight: bold; text-decoration: none;">Bag 은 요소의 중복을 판단할때 각 요소에서 제공되는 </ins>=<ins style="font-weight: bold; text-decoration: none;">(equal) 메서드를 사용합니다; 이런 클래스의 </ins>Identity <ins style="font-weight: bold; text-decoration: none;">등과 같은 변종은 두개의 인수(파라메터)가 같은 객체인가를 </ins>테스트하는 ==<ins style="font-weight: bold; text-decoration: none;">(double equal) 을 사용하며, Pluggable 같은 변종은 </ins>컬렉션의 <ins style="font-weight: bold; text-decoration: none;">생성시에 주어진 임의의 동치관계(메서드)를 </ins>사용합니다.</div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* '''<ins style="font-weight: bold; text-decoration: none;">혼합가능</ins>(Heterogeneous)''': 대부분의 컬렉션들은 <ins style="font-weight: bold; text-decoration: none;">요소가 어떤 종류라 하더라도 수용이 가능합니다</ins>. <ins style="font-weight: bold; text-decoration: none;">하지만</ins>, String, CharacterArray 또는 <ins style="font-weight: bold; text-decoration: none;">Symbol 은 Chracter 만을 수용할 수 </ins>있습니다. <ins style="font-weight: bold; text-decoration: none;">Array 는 여러가지 객체를 수용할 수 있지만</ins>, <ins style="font-weight: bold; text-decoration: none;">ByteArray 는 </ins>오직 <ins style="font-weight: bold; text-decoration: none;">Bytes 만 수용하며</ins>, <ins style="font-weight: bold; text-decoration: none;">IntergerArray 는 </ins>오직 <ins style="font-weight: bold; text-decoration: none;">Integer 를 수용하고</ins>, <ins style="font-weight: bold; text-decoration: none;">FloatArray 는 </ins>오직 <ins style="font-weight: bold; text-decoration: none;">Floats 만을 수용합니다</ins>. <ins style="font-weight: bold; text-decoration: none;">LinkedList 는 </ins>Link ▷ accessing <ins style="font-weight: bold; text-decoration: none;">protocol 을 준수하는 요소만 수용가능한 제약을 가집니다.</ins>.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
</table>
Onionmixer
https://trans.onionmixer.net/mediawiki/index.php?title=SqueakByExample:9.2&diff=2078&oldid=prev
Onionmixer: 번역수정
2013-08-13T12:56:19Z
<p>번역수정</p>
<p><b>New page</b></p><div>==컬렉션의 다양성==<br />
<br />
컬렉션 클래스를 보다 잘 사용하기 위해, 사용자는 적어도 컬렉션 클래스들의 외형 및 컬렉션 클래스들의 공통점들과 차이점들에 대한 지식을 알고 있는것이 좋습니다. <br />
<br />
각각의 구성요소들보다는, 컬렉션들을 사용하여 프로그래밍을 하는 것이 프로그램의 추상성의 수준을 끌어올릴 수 있는 보다 중요한 방법입니다. Lisp 언어의 map 함수는 함수와 목록을 인수로 받아서 목록의 각 요소에 각각 함수를 적용해서 결과를 목록으로 반환하며, Smalltalk-80 은 핵심원리로 (이런스타일을 따라) 컬렉션 기반 프로그래밍을 채택하였으며, ML 과 Haskell 과 같은 현대 함수기반 프로그래밍 언어들은 스몰토크의 스타일를 따랐다고 할 수 있습니다.<br />
<br />
왜 이런것이 좋은 아이디어 일까요? 예를 들면 학생에 대한 레코드의 집합인 데이터 구조가 있고, 몇가지 기준에 부합하는 모든 학생의 레코드에 대해 같은 동작을 진행하기 원한다고 하죠. 기존의 언어를 사용하는 프로그래머라면 반복문을 바로 생각하겠지만, 스몰토크 프로그래머는 다음처럼 표현식 을 작성할 것입니다.<br />
<br />
<syntaxhighlight lang="smalltalk"><br />
students select: [ :each | each gpa < threshold ]<br />
</syntaxhighlight><br />
<br />
<br />
위의 표현식은 대괄호 안의 함수가 '''true'''<ref name="주석9-2">대괄호에 있는 표현식은 익명의 함수 '''_x.x gpa < threshold''' 를 정의하는 표현식으로서 간주될 수 있습니다.</ref> 를 반환할때 students 의 element 를 포함하는 새 컬렉션으로 평가(evaluates)합니다. 스몰토크 코드는 도메인-특화 조회 언어의 단순성과 우아함을 갖고 있습니다. <br />
<br />
<br />
그림 9.3: 표준 컬렉션 프로토콜<br />
<br />
{| class="wikitable" style="border: 1px solid black;"<br />
|-<br />
!Protocol||Methods<br />
|-<br />
|accessing||size, capacity, at: anIndex , at: anIndex put: anElement<br />
|-<br />
|testing||isEmpty, includes: anElement , contains: aBlock ,occurrencesOf: anElement<br />
|-<br />
|adding||add: anElement , addAll: aCollection<br />
|-<br />
|removing||remove: anElement , remove: anElement ifAbsent: aBlock ,removeAll: aCollection<br />
|-<br />
|enumerating||do: aBlock , collect: aBlock , select: aBlock , reject: aBlock ,detect: aBlock , detect: aBlock ifNone: aNoneBlock ,inject: aValue into: aBinaryBlock<br />
|-<br />
|converting||asBag, asSet, asOrderedCollection, asSortedCollection,asArray, asSortedCollection: aBlock<br />
|-<br />
|creation||with: anElement , with:with:, with:with:with:,with:with:with:with:, withAll: aCollection<br />
|}<br />
<br />
<br />
메시지 select: 는 스몰토크의 모든 컬렉션에 전달될 수 있습니다. students 의 데이터 구조가 배열 또는 linked list 인지를 확인할 필요는 없습니다: select: 메시지는 양쪽 모두에 전달될 수 있습니다. 반복(loop)를 사용하는경우에는 students 가 배열인지 linked list 인지를 미리 알아두어야 합니다만, 반복과는 다르다는것에 주의해주시기 바랍니다. 스몰토크에서, 특정 컬렉션을 지칭하지않고 그냥 '''컬렉션''' 이라고만 하는 경우는, element 가 대상이 되는 객체에 들어있는지를 테스트하고 열거하기위한 잘 정의된 프로토콜을 지원하는 객체를 의미합니다<ref name="참고1">c++의 경우는 iterator 가 이와 비슷합니다.</ref>. 모든 스몰토크의 컬렉션은 isEmpty 와 occurrencesOf: 을 포함한 테스팅 메시지를 사용할 수 있습니다. 또한 모든 컬렉션은 열거 메시지 do:,select:, reject: (select: 의 반대되는 것), collect:(Lisp 의 map 과 같은), detect:ifNone:, inject:into: (왼쪽 fold를 수행하는)과 더 많은 메시지를 사용할 수 있습니다. 이런 프로토콜의 범용성과 다양성은 컬렉션을 강력하게 만들어주는 특징입니다.<br />
<br />
<br />
그림 9.3을 통해 컬렉션 계층의 대다수 클래스들이 지원하는 표준 프로토콜을 정리했습니다. 이 메서드들은 Collection 을 상속받은 서브클래스 내에서 정의(define), 재 정의(redefine), 최적화(optimized) 도 가능하지만, 가끔 (서브클래스를 통한)사용이 금지되기도 합니다.<br />
<br />
<br />
기본적인 일관성을 넘어선, 다양한 프로토콜들을 지원하거나 같은 요청에 다른동작을 제공하는 다수의 다른 컬렉션이 있습니다. 이제부터 중요한 몇가지 차이점들에 대해 알아보도록 하겠습니다:<br />
<br />
<br />
* '''순차가능(Sequenceable)''': 첫 번째 구성요소에서 시작하여 마지막 구성요소에 이르기까지 잘 정의된 순서로 진행되는 SequenceableCollection의 모든 서브클래스들의 인스턴스들입니다. 다른 한편으로는, Set, Bag 그리고 딕셔너리의 인스턴스들은 순차적으로 배치할 수 없습니다.<br />
* '''분류가능(Sortable)''': SortedCollection은 분류 수서에 따라 자체의 구성요소들을 유지합니다.<br />
* '''색인가능(Indexable)''': 가장 순차가능 컬렉션들은 또한 at:과 함께 검색할 수 있는 구성요소인 색인가능입니다. 배열은 고정된 크기를 가진 친숙한 indexable 데이터 구조이며 anArray at: n은 anArray의 nth 구성요소를 검색하며, anArray at: n put: v은 v에 nth 구성요소를 부과합니다. LinkedLists 와 SkipLists 은 sequenceable 이지만, indexable이 아닙니다. 그 의미는 이것들은 first와 last를 이해하지만 at:은 이해하지 못합니다. <br />
* '''Keyed''': 딕셔너리의 인스턴스들이며, 이것의 서브클래스들은 indices 대신에 keys로 접근할 수 있습니다. <br />
* '''수정가능(Mutable)''': Mutable: 대부분의 컬렉션들은 수정 가능하지만, 인터벌과 심볼은 그렇지 않습니다. 인터벌(Interval)은 정수의 범위를 나타내는 수정 불가능 컬렉션입니다. 예를 들면 5 to: 16 by: 2 는 구성요소 5, 7, 9, 11, 13과 15를 포함하고 있는 인터벌입니다. 이것은 at:과 함께 indexable 이지만, at:put:으로 변경될 수 없습니다.<br />
* '''성장가능(Growable)''': 인터벌의 인스턴스들과 배열은 항상 고정된 크기를 가집니다. 다른 컬렉션 종류는 (분류된 컬렉션, 순서가 정렬된 컬렉선 그리고 링크된 목록들)은 만들어진 이후에 성장할 수 있습니다. 클래스 OrderedCollection은 배열보다 좀더 일반적인 것이며, OrderedCollection의 크기는 성장할 것이고, 또한 그것은 at:과 at:put: 뿐만 아니라 addFirst:와 addLast:를 위한 메소드를 갖고 있습니다. <br />
* '''복제물 수락(Accepts duplicates)''': Set은 복제물을 걸러내겠지만, Bag은 그렇지 않을 것입니다. Dictionary, Set 그리고 Bag은 구성요소들에 의해 제공된 = 메소드를 사용하며, 이 클래스들의 Identity 변수들은 인수들이 동일한 오브젝트인지를 테스트하는 == 메소드를 사용하고 Puggable 변수들은 컬렉션의 생성자에 의해 공급된 임시 등가 관계를 사용합니다. <br />
* '''혼합(Heterogeneous)''': 대부분의 컬렉션들은 모든 구성요소들의 종류를 보유할 것입니다. 그럼에도 불구하고, String, CharacterArray 또는 심볼은 오직 문자만을 보유하고 있습니다. 배열은 모든 오브젝트의 혼합을 보유할 것이만, ByteArray는 오직 Bytes만을 보유하며, IntergerArray는 오직 정수들을 보유하며, FloatArray는 오직 Floats를 보유합니다. LinkedList는 프로토콜에 Link ▷ accessing protocol에 맞는 구성요소들을 보유하기 위해 제약됩니다.<br />
<br />
<br />
<br />
==Notes==<br />
<references /><br />
<br />
[[Category:SqueakByExample]]</div>
Onionmixer
https://trans.onionmixer.net/mediawiki/index.php?title=SqueakByExample:9.2&diff=2074&oldid=prev
221.112.56.98 at 01:34, 17 August 2012
2012-08-17T01:34:31Z
<p></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 01:34, 17 August 2012</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l53">Line 53:</td>
<td colspan="2" class="diff-lineno">Line 53:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* '''복제물 수락(Accepts duplicates)''': Set은 복제물(duplicates)들을 걸러낼 것이지만, Bag은 그렇지 않을 것입니다. Dictionary, Set 그리고 Bag은 구성요소들에 의해 제공된 = 메소드를 사용하며, 이 클래스들의 Identity 변수들은 인수들이 동일한 오브젝트인지를 테스트하는 = = 메소드를 사용하고 Puggable 변수들은 컬렉션의 생성자(the creator)에 의해 공급된 임시 등가 관계 (arbitrary equivalence relation)을 사용합니다. </div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* '''복제물 수락(Accepts duplicates)''': Set은 복제물(duplicates)들을 걸러낼 것이지만, Bag은 그렇지 않을 것입니다. Dictionary, Set 그리고 Bag은 구성요소들에 의해 제공된 = 메소드를 사용하며, 이 클래스들의 Identity 변수들은 인수들이 동일한 오브젝트인지를 테스트하는 = = 메소드를 사용하고 Puggable 변수들은 컬렉션의 생성자(the creator)에 의해 공급된 임시 등가 관계 (arbitrary equivalence relation)을 사용합니다. </div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* '''혼합(Heterogeneous)''': 대부분의 컬렉션들은 모든 구성요소들의 종류를 보유할 것입니다. 그럼에도 불구하고, String, CharacterArray 또는 심볼은 오직 문자(Charaters)만을 보유하고 있습니다. 배열(Array)는 모든 오브젝트의 혼합을 보유할 것이만, ByteArray는 오직 Bytes만을 보유하며, IntergerArray는 오직 정수들을 보유하며, FloatArray는 오직 Floats를 보유합니다. LinkedList는 프로토콜에 Link ▷ accessing protocol에 맞는 구성요소들을 보유하기 위해 제약됩니다. </div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* '''혼합(Heterogeneous)''': 대부분의 컬렉션들은 모든 구성요소들의 종류를 보유할 것입니다. 그럼에도 불구하고, String, CharacterArray 또는 심볼은 오직 문자(Charaters)만을 보유하고 있습니다. 배열(Array)는 모든 오브젝트의 혼합을 보유할 것이만, ByteArray는 오직 Bytes만을 보유하며, IntergerArray는 오직 정수들을 보유하며, FloatArray는 오직 Floats를 보유합니다. LinkedList는 프로토콜에 Link ▷ accessing protocol에 맞는 구성요소들을 보유하기 위해 제약됩니다. </div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;"></del></div></td><td colspan="2" class="diff-side-added"></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;"></del></div></td><td colspan="2" class="diff-side-added"></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">[[image:CollectionsByImpl.png|none|1078px|thumb|그림 9.4: 실행 테크닉에 의해 범주화된 몇몇 컬렉션 클래스들]]</del></div></td><td colspan="2" class="diff-side-added"></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
</table>
221.112.56.98
https://trans.onionmixer.net/mediawiki/index.php?title=SqueakByExample:9.2&diff=2073&oldid=prev
Onionmixer at 11:21, 16 August 2012
2012-08-16T11:21:24Z
<p></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 11:21, 16 August 2012</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l45">Line 45:</td>
<td colspan="2" class="diff-lineno">Line 45:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>* 순차가능(Sequenceable): 첫 번째 구성요소에서 시작하여 마지막 구성요소에 이르기까지 잘 정의된 순서로 진행되는 SequenceableCollection의 모든 서브클래스들의 인스턴스들입니다. 다른 한편으로는, Set, Bag 그리고 딕셔너리의 인스턴스들은 순차가능(Sequenceable)이 아닙니다.</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* <ins style="font-weight: bold; text-decoration: none;">'''</ins>순차가능(Sequenceable)<ins style="font-weight: bold; text-decoration: none;">'''</ins>: 첫 번째 구성요소에서 시작하여 마지막 구성요소에 이르기까지 잘 정의된 순서로 진행되는 SequenceableCollection의 모든 서브클래스들의 인스턴스들입니다. 다른 한편으로는, Set, Bag 그리고 딕셔너리의 인스턴스들은 순차가능(Sequenceable)이 아닙니다.</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>* 분류가능(Sortable): SortedCollection은 분류 수서에 따라 자체의 구성요소들을 유지합니다.</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* <ins style="font-weight: bold; text-decoration: none;">'''</ins>분류가능(Sortable)<ins style="font-weight: bold; text-decoration: none;">'''</ins>: SortedCollection은 분류 수서에 따라 자체의 구성요소들을 유지합니다.</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>* 색인가능(Indexable): 가장 순차가능(sequenceable) 컬렉션들은 또한 at:과 함께 검색(retrieved)할 수 있는 구성요소인 색인가능(indexable)입니다. 배열(array)은 고정된 크기를 가진 친숙한 indexable 데이터 구조이며 anArray at: n은 anArray의 nth 구성요소를 검색(retrieve)하며, anArray at: n put: v은 v에 nth 구성요소를 부과(charges)합니다. LinkedLists 와 SkipLists 은 sequenceable 이지만, indexable이 아닙니다. 그 의미는 이것들은 first와 last를 이해하지만 at:은 이해하지 못합니다. </div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* <ins style="font-weight: bold; text-decoration: none;">'''</ins>색인가능(Indexable)<ins style="font-weight: bold; text-decoration: none;">'''</ins>: 가장 순차가능(sequenceable) 컬렉션들은 또한 at:과 함께 검색(retrieved)할 수 있는 구성요소인 색인가능(indexable)입니다. 배열(array)은 고정된 크기를 가진 친숙한 indexable 데이터 구조이며 anArray at: n은 anArray의 nth 구성요소를 검색(retrieve)하며, anArray at: n put: v은 v에 nth 구성요소를 부과(charges)합니다. LinkedLists 와 SkipLists 은 sequenceable 이지만, indexable이 아닙니다. 그 의미는 이것들은 first와 last를 이해하지만 at:은 이해하지 못합니다. </div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>* Keyed: 딕셔너리의 인스턴스들이며, 이것의 서브클래스들은 indices 대신에 keys로 접근할 수 있습니다. </div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* <ins style="font-weight: bold; text-decoration: none;">'''</ins>Keyed<ins style="font-weight: bold; text-decoration: none;">'''</ins>: 딕셔너리의 인스턴스들이며, 이것의 서브클래스들은 indices 대신에 keys로 접근할 수 있습니다. </div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>* 수정가능(Mutable): Mutable: 대부분의 컬렉션들은 수정가능(mutable)하지만, 인터벌(Interval)과 심볼(Symbols)은 그렇지 않습니다. 인터벌(Interval)은 정수의 범위를 나타내는 수정불가능(immutable) 컬렉션입니다. 예를 들면 5 to: 16 by: 2 는 구성요소 5, 7, 9, 11, 13과 15를 포함하고 있는 인터벌입니다. 이것은 at:과 함께 indexable 이지만, at:put:으로 변경될 수 없습니다.</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* <ins style="font-weight: bold; text-decoration: none;">'''</ins>수정가능(Mutable)<ins style="font-weight: bold; text-decoration: none;">'''</ins>: Mutable: 대부분의 컬렉션들은 수정가능(mutable)하지만, 인터벌(Interval)과 심볼(Symbols)은 그렇지 않습니다. 인터벌(Interval)은 정수의 범위를 나타내는 수정불가능(immutable) 컬렉션입니다. 예를 들면 5 to: 16 by: 2 는 구성요소 5, 7, 9, 11, 13과 15를 포함하고 있는 인터벌입니다. 이것은 at:과 함께 indexable 이지만, at:put:으로 변경될 수 없습니다.</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>* 성장가능(Growable): 인터벌(Interval)의 인스턴스들과 배열(Array)는 항상 고정된 크기를 가집니다. 다른 컬렉션(collections) 종류들은 (분류된 컬렉션, 순서가 정렬된 컬렉선 그리고 링크된 목록들)은 만들어진 이후에 성장할 수 있습니다. 클래스 OrderedCollection은 배열(Array)보다 좀더 일반적인 것이며, OrderedCollection의 크기는 성장할 것이고, 또한 그것은 at:과 at:put: 뿐만 아니라 addFirst:와 addLast:를 위한 메소드를 갖고 있습니다. </div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* <ins style="font-weight: bold; text-decoration: none;">'''</ins>성장가능(Growable)<ins style="font-weight: bold; text-decoration: none;">'''</ins>: 인터벌(Interval)의 인스턴스들과 배열(Array)는 항상 고정된 크기를 가집니다. 다른 컬렉션(collections) 종류들은 (분류된 컬렉션, 순서가 정렬된 컬렉선 그리고 링크된 목록들)은 만들어진 이후에 성장할 수 있습니다. 클래스 OrderedCollection은 배열(Array)보다 좀더 일반적인 것이며, OrderedCollection의 크기는 성장할 것이고, 또한 그것은 at:과 at:put: 뿐만 아니라 addFirst:와 addLast:를 위한 메소드를 갖고 있습니다. </div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>* 복제물 수락(Accepts duplicates): Set은 복제물(duplicates)들을 걸러낼 것이지만, Bag은 그렇지 않을 것입니다. Dictionary, Set 그리고 Bag은 구성요소들에 의해 제공된 = 메소드를 사용하며, 이 클래스들의 Identity 변수들은 인수들이 동일한 오브젝트인지를 테스트하는 = = 메소드를 사용하고 Puggable 변수들은 컬렉션의 생성자(the creator)에 의해 공급된 임시 등가 관계 (arbitrary equivalence relation)을 사용합니다. </div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* <ins style="font-weight: bold; text-decoration: none;">'''</ins>복제물 수락(Accepts duplicates)<ins style="font-weight: bold; text-decoration: none;">'''</ins>: Set은 복제물(duplicates)들을 걸러낼 것이지만, Bag은 그렇지 않을 것입니다. Dictionary, Set 그리고 Bag은 구성요소들에 의해 제공된 = 메소드를 사용하며, 이 클래스들의 Identity 변수들은 인수들이 동일한 오브젝트인지를 테스트하는 = = 메소드를 사용하고 Puggable 변수들은 컬렉션의 생성자(the creator)에 의해 공급된 임시 등가 관계 (arbitrary equivalence relation)을 사용합니다. </div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>* 혼합(Heterogeneous): 대부분의 컬렉션들은 모든 구성요소들의 종류를 보유할 것입니다. 그럼에도 불구하고, String, CharacterArray 또는 심볼은 오직 문자(Charaters)만을 보유하고 있습니다. 배열(Array)는 모든 오브젝트의 혼합을 보유할 것이만, ByteArray는 오직 Bytes만을 보유하며, IntergerArray는 오직 정수들을 보유하며, FloatArray는 오직 Floats를 보유합니다. LinkedList는 프로토콜에 Link ▷ accessing protocol에 맞는 구성요소들을 보유하기 위해 제약됩니다. </div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* <ins style="font-weight: bold; text-decoration: none;">'''</ins>혼합(Heterogeneous)<ins style="font-weight: bold; text-decoration: none;">'''</ins>: 대부분의 컬렉션들은 모든 구성요소들의 종류를 보유할 것입니다. 그럼에도 불구하고, String, CharacterArray 또는 심볼은 오직 문자(Charaters)만을 보유하고 있습니다. 배열(Array)는 모든 오브젝트의 혼합을 보유할 것이만, ByteArray는 오직 Bytes만을 보유하며, IntergerArray는 오직 정수들을 보유하며, FloatArray는 오직 Floats를 보유합니다. LinkedList는 프로토콜에 Link ▷ accessing protocol에 맞는 구성요소들을 보유하기 위해 제약됩니다. </div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
</table>
Onionmixer
https://trans.onionmixer.net/mediawiki/index.php?title=SqueakByExample:9.2&diff=2072&oldid=prev
Onionmixer: SBE 컬렉션의다양성 페이지 추가
2012-08-16T11:16:36Z
<p>SBE 컬렉션의다양성 페이지 추가</p>
<p><b>New page</b></p><div>==컬렉션의 다양성(The varieties of collections)==<br />
<br />
컬렉션 클래스들을(the collections classes) 훌륭하게 활용하기 위해, 리더(reader)는 컬렉션 클래스들이 실행하는 것들과, 컬렉션 클래스들의 공통점들과 차이점들에 대해 적어도 피상적인 지식이라도 필요합니다. <br />
<br />
개별적인 구성요소들보다는, 컬렉션들을 사용하여 프로그래밍을 하는 것은 프로그램의 추상성의 수준을 끌어올릴 수 있는 중요한 방법입니다. 리습 기능 맵(The Lisp function map)은 인수 함수(an argument function)를 목록의 모든 구성요소에 적용하며 이 형식의 초기 예시인 결과들을 포함하는 새로운 목록을 리턴하지만, 스몰토크-80(Smalltalk-80)은 중앙 원리로서(central tenet) 컬렉션 기초 프로그래밍(collection-based programming)을 채택하였습니다. ML과 Haskell과 같은 현대의 기능적 프로그래밍(Modern functional programming) 언어들은 스몰토크의 인도를 따라 왔습니다.<br />
<br />
왜 이것이 좋은 아이디어 일까요? 여러분이 학생 기록들(student records)의 컬렉션을 포함하고 있는 데이터 구조(a data structure)를 갖고 있으며, 몇 가지 기준(criterion)을 충족시키는 모든 학생들에게 몇 가지 액션을 수행하기를 원한다고 가정해 보십시오. 프로그래머들은 즉시 루프에 도달하기 위한 필수불가결한 언어 사용을 제기할 것이지만 스몰토크 프로그래머는 다음 표현식 을 작성할 것입니다.<br />
<br />
<syntaxhighlight lang="smalltalk"><br />
students select: [ :each | each gpa < threshold ]<br />
</syntaxhighlight><br />
<br />
<br />
꺽쇠 괄호(대괄호가)안에 들어 있는 '''true'''<ref name="주석9-2">대괄호에 있는 표현식은 익명의 함수 _x.x gpa<threshold를 정의하는 표현식으로서 간주될 수 있습니다.</ref>를 리턴하는 함수를 위해 정확하게 학생들의 구성요소들을 포함하고 있는 새로운 컬렉션 (new collection)을 평가합니다. 스몰토크 코드는 도메인-지정 조회 언어(a domain-specific query language)의 단순성과 우아함을 갖고 있습니다. <br />
<br />
<br />
그림 9.3: 표준 컬렉션 프로토콜(Standard Collection protocols)<br />
{| class="wikitable" style="border: 1px solid black;"<br />
|-<br />
!Protocol||Methods<br />
|-<br />
|accessing||size, capacity, at: anIndex , at: anIndex put: anElement<br />
|-<br />
|testing||isEmpty, includes: anElement , contains: aBlock ,occurrencesOf: anElement<br />
|-<br />
|adding||add: anElement , addAll: aCollection<br />
|-<br />
|removing||remove: anElement , remove: anElement ifAbsent: aBlock ,removeAll: aCollection<br />
|-<br />
|enumerating||do: aBlock , collect: aBlock , select: aBlock , reject: aBlock ,detect: aBlock , detect: aBlock ifNone: aNoneBlock ,inject: aValue into: aBinaryBlock<br />
|-<br />
|converting||asBag, asSet, asOrderedCollection, asSortedCollection,asArray, asSortedCollection: aBlock<br />
|-<br />
|creation||with: anElement , with:with:, with:with:with:,with:with:with:with:, withAll: aCollection<br />
|}<br />
<br />
<br />
메시지 select:는 스몰토크에서 모든 컬렉션에 의해 이해될 수 있습니다. 만약 학생 데이터 구조(the student data structure)가 배열 (array) 또는 링크된 목록(linked list)인지를 알아낼 필요가 없습니다: select: 메시지는 둘 모두에 의해 이해될 수 있습니다. 이것은 프로그래머가 루프가 셋업되기 전에 학생이(student)가 배열인지 링크된 목록인지를 반드시 알아야 하는 장소인 루프를 사용하는 것과는 꽤 다르다는 것을 주지해 주십시오.<br />
<br />
스몰토크에서는, 누군가가 컬렉션의 종류에 관해 좀더 특별히 지정하지 않고 컬렉션에 관해 말할 때, 그 사람은 멤버쉽(membership)을 테스트하고 구성요소들을 열거하기 위해 잘 정의된 프로토콜들을 지원하는 오브젝트를 의미하는 것입니다. 모든 컬렉션은 isEmpty 와 occurrencesOf:을 포함한 테스팅 메시지(the testing message)를 이해합니다. 모든 컬렉션은 열거 메시지들(the enumeration messages) do:,select:, reject: (select:의 반대되는 것), collect:(리습의 맵과 같은), detect:ifNone:, inject:into: (왼쪽 fold를 수행하는)과 더 많은 메시지를 이해합니다. 이와 같은 내용은 컬렉션을 강력하게 만드는 다양성 뿐만 아니라, 편재성을 의미합니다.<br />
<br />
그림 9.3은 컬렉션 계층도(the collection hierarchy)에서 대부분의 클래스들에 의해 지원되는 표준 프로토콜을 요약합니다. 이 메소드들은 정의되고, 재 정의되고 최적화되거나 또는 종종 컬렉션의 서브클래스에 의해 금지되기도 합니다.<br />
<br />
기본적인 균일성을 넘어서서, 다양한 프로토콜들을 지원하거나 동일한 요청들에 다른 동작을 제공하는 많은 다른 종류의 컬렉션이 있습니다. 이제 우리는 중요한 차이점들의 몇 가지를 간략하게 조사할 것입니다:<br />
<br />
<br />
* 순차가능(Sequenceable): 첫 번째 구성요소에서 시작하여 마지막 구성요소에 이르기까지 잘 정의된 순서로 진행되는 SequenceableCollection의 모든 서브클래스들의 인스턴스들입니다. 다른 한편으로는, Set, Bag 그리고 딕셔너리의 인스턴스들은 순차가능(Sequenceable)이 아닙니다.<br />
* 분류가능(Sortable): SortedCollection은 분류 수서에 따라 자체의 구성요소들을 유지합니다.<br />
* 색인가능(Indexable): 가장 순차가능(sequenceable) 컬렉션들은 또한 at:과 함께 검색(retrieved)할 수 있는 구성요소인 색인가능(indexable)입니다. 배열(array)은 고정된 크기를 가진 친숙한 indexable 데이터 구조이며 anArray at: n은 anArray의 nth 구성요소를 검색(retrieve)하며, anArray at: n put: v은 v에 nth 구성요소를 부과(charges)합니다. LinkedLists 와 SkipLists 은 sequenceable 이지만, indexable이 아닙니다. 그 의미는 이것들은 first와 last를 이해하지만 at:은 이해하지 못합니다. <br />
* Keyed: 딕셔너리의 인스턴스들이며, 이것의 서브클래스들은 indices 대신에 keys로 접근할 수 있습니다. <br />
* 수정가능(Mutable): Mutable: 대부분의 컬렉션들은 수정가능(mutable)하지만, 인터벌(Interval)과 심볼(Symbols)은 그렇지 않습니다. 인터벌(Interval)은 정수의 범위를 나타내는 수정불가능(immutable) 컬렉션입니다. 예를 들면 5 to: 16 by: 2 는 구성요소 5, 7, 9, 11, 13과 15를 포함하고 있는 인터벌입니다. 이것은 at:과 함께 indexable 이지만, at:put:으로 변경될 수 없습니다.<br />
* 성장가능(Growable): 인터벌(Interval)의 인스턴스들과 배열(Array)는 항상 고정된 크기를 가집니다. 다른 컬렉션(collections) 종류들은 (분류된 컬렉션, 순서가 정렬된 컬렉선 그리고 링크된 목록들)은 만들어진 이후에 성장할 수 있습니다. 클래스 OrderedCollection은 배열(Array)보다 좀더 일반적인 것이며, OrderedCollection의 크기는 성장할 것이고, 또한 그것은 at:과 at:put: 뿐만 아니라 addFirst:와 addLast:를 위한 메소드를 갖고 있습니다. <br />
* 복제물 수락(Accepts duplicates): Set은 복제물(duplicates)들을 걸러낼 것이지만, Bag은 그렇지 않을 것입니다. Dictionary, Set 그리고 Bag은 구성요소들에 의해 제공된 = 메소드를 사용하며, 이 클래스들의 Identity 변수들은 인수들이 동일한 오브젝트인지를 테스트하는 = = 메소드를 사용하고 Puggable 변수들은 컬렉션의 생성자(the creator)에 의해 공급된 임시 등가 관계 (arbitrary equivalence relation)을 사용합니다. <br />
* 혼합(Heterogeneous): 대부분의 컬렉션들은 모든 구성요소들의 종류를 보유할 것입니다. 그럼에도 불구하고, String, CharacterArray 또는 심볼은 오직 문자(Charaters)만을 보유하고 있습니다. 배열(Array)는 모든 오브젝트의 혼합을 보유할 것이만, ByteArray는 오직 Bytes만을 보유하며, IntergerArray는 오직 정수들을 보유하며, FloatArray는 오직 Floats를 보유합니다. LinkedList는 프로토콜에 Link ▷ accessing protocol에 맞는 구성요소들을 보유하기 위해 제약됩니다. <br />
<br />
<br />
[[image:CollectionsByImpl.png|none|1078px|thumb|그림 9.4: 실행 테크닉에 의해 범주화된 몇몇 컬렉션 클래스들]]<br />
<br />
<br />
==Notes==<br />
<references /><br />
<br />
[[Category:SqueakByExample]]</div>
Onionmixer