https://trans.onionmixer.net/mediawiki/index.php?title=SqueakByExample:10.1&feed=atom&action=historySqueakByExample:10.1 - Revision history2024-03-28T13:22:57ZRevision history for this page on the wikiMediaWiki 1.38.1https://trans.onionmixer.net/mediawiki/index.php?title=SqueakByExample:10.1&diff=2129&oldid=prevOnionmixer: 번역수정2013-09-14T04:04:39Z<p>번역수정</p>
<p><b>New page</b></p><div>==두 요소에 대한 순서(sequences)==<br />
<br />
Stream 을 이해하는 데에 쓰이는 다음과 같은 유용한 비유가 있습니다: Stream 2 개의 구성요소의 나열이라고 할 수 있습니다: 이 2 개의 요소는 이전순서에 해당하는 요소와 다음순서에 해당하는 요소를 말합니다. 이런 모델에 대한 이해는 대단히 중요한데, 왜냐하면 스몰토크에서 모든 Stream 연산은 이 모델을 기본으로 하고있기 때문입니다. 이때문에 대부분의 Stream 클래스들은 PositionableStream 의 서브클래스가 됩니다. 그림 10.1 은 5 개의 Chracter 를 포함하고 있는 Stream 을 보여주고 있습니다. 이경우, Stream 은 처음의 위치에 있으며 이전요소는 가지고 있지 않습니다(stream 내의 position을 의미합니다). 사용자는 reset 이라는 메시지를 사용해서 이 위치를 초기화 시킬 수 있습니다.<br />
<br />
[[image:_abcdeStef.png|none|910px|thumb|그림 10.1: 시작 시점에, 위치를 잡은 stream]]<br />
<br />
<br />
요소를 읽는다 라는 행동을 개념적으로 본다면, 다음순서 요소를 떼어낸다음 그걸 이전요소의 뒷부분에 붙인다는것을 말합니다<ref name="역자주1">지금 현재의 position을 기준으로 다음의 element 를 가져와서 이전 element 의 뒤쪽으로 결합한다는 의미입니다. 결국 1:4 인 배열을 2:3 으로 바꾼다라는 의미가 되겠습니다.</ref>.<br />
<br />
next 메시지를 사용해서 하나의 구성요소를 읽은 후, Stream 의 상태는 그림 10.2 처럼 변경됩니다. <br />
<br />
[[image:a_bcdeStef.png|none|910px|thumb|그림 10.2: 그림 10.1 의 stream 에 next 메시지를 송신한 다음의 상태. chracter a 는 이전에 속하지만 b, c, d, e 는 다음에 속하게 된다.]]<br />
<br />
<br />
<br />
요소를 작성<sup>write</sup> 한다는 것은, 현재 위치에 대한 다음 시퀀스의 앞쪽에 새로운 요소를 교대시키고, 이전 요소의 위치로 새로 바뀐 요소를 이동시킨다는 의미가 됩니다. 그림 10.3 은 메시지 nextPut:anElement 를 사용하여 x 를 작성<sup>write</sup>한 이후의 stream 의 상태를 보여주고 있습니다.<br />
<br />
[[image:ax_cdeStef.png|none|910px|thumb|그림 10.3: x 를 write 작업한 이후의 stream]]<br />
<br />
<br />
<br />
==Notes==<br />
<references /><br />
<br />
[[Category:SqueakByExample]]</div>Onionmixerhttps://trans.onionmixer.net/mediawiki/index.php?title=SqueakByExample:10.1&diff=2125&oldid=prevOnionmixer at 05:10, 30 August 20122012-08-30T05:10:18Z<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 05:10, 30 August 2012</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l9">Line 9:</td>
<td colspan="2" class="diff-lineno">Line 9:</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>메시지 next를 사용하여 하나의 구성요소를 읽은 후에, 여러분의 스트림(stream)의 상태는 그림 10.2에 나타납니다. </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>메시지 next를 사용하여 하나의 구성요소를 읽은 후에, 여러분의 스트림(stream)의 상태는 그림 10.2에 나타납니다. </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>[[image:a_bcdeStef.png|none|910px|thumb|그림 10.2: <del style="font-weight: bold; text-decoration: none;">메소드 </del>next:의 실행 이후에 동일한 스트림(stream) ]]</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>[[image:a_bcdeStef.png|none|910px|thumb|그림 10.2: <ins style="font-weight: bold; text-decoration: none;">메서드 </ins>next:의 실행 이후에 동일한 스트림(stream) ]]</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>문자 b,c,d 그리고 e는 <del style="font-weight: bold; text-decoration: none;">“미래에</del>(in the future)<del style="font-weight: bold; text-decoration: none;">”에 </del>있는 반면에 문자 a는 <del style="font-weight: bold; text-decoration: none;">“과거에</del>(in the past)<del style="font-weight: bold; text-decoration: none;">”에 </del>있습니다. 구성요소를 작성(쓰기) 한다는 의미는 새로운 것으로 미래 시퀀스(the future sequence)의 첫 번째 구성요소를 대체하는 것이고, 과거(the past)로 그 구성요소를 이동시킨다는 것입니다. 그림 10.3은 메시지 nextPut:anElement를 사용하여 x를 쓰기 한 이후의 동일한 스트림(stream)의 상태를 보여 드리고 있습니다.</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>문자 b,c,d 그리고 e는 <ins style="font-weight: bold; text-decoration: none;">"미래에</ins>(in the future)<ins style="font-weight: bold; text-decoration: none;">"에 </ins>있는 반면에 문자 a는 <ins style="font-weight: bold; text-decoration: none;">"과거에</ins>(in the past)<ins style="font-weight: bold; text-decoration: none;">"에 </ins>있습니다. 구성요소를 작성(쓰기) 한다는 의미는 새로운 것으로 미래 시퀀스(the future sequence)의 첫 번째 구성요소를 대체하는 것이고, 과거(the past)로 그 구성요소를 이동시킨다는 것입니다. 그림 10.3은 메시지 nextPut:anElement를 사용하여 x를 쓰기 한 이후의 동일한 스트림(stream)의 상태를 보여 드리고 있습니다.</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>[[image:ax_cdeStef.png|none|910px|thumb|그림 10.3: x에 쓰기 이후 동일한 스트림]]</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>[[image:ax_cdeStef.png|none|910px|thumb|그림 10.3: x에 쓰기 이후 동일한 스트림]]</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>Onionmixerhttps://trans.onionmixer.net/mediawiki/index.php?title=SqueakByExample:10.1&diff=2124&oldid=prevOnionmixer: SBE 구성요소들의두개의시퀀스2012-08-17T04:17:17Z<p>SBE 구성요소들의두개의시퀀스</p>
<p><b>New page</b></p><div>==구성요소들의 두 개의 시퀀스==<br />
<br />
스트림을 이해하는 훌륭한 비유는 다음과 같습니다: 스트림(stream)은 2 개의 구성요소의 시퀀스들로 나타날 수 있습니다: 그것들은 과거 구성요소 시퀀스(a past element sequence)와 미래 구성요소 시퀀스(future element sequence)입니다. 스트림은 두 개의 시퀀스 사이에 위치합니다. 이 모델에 대한 이해는 중요하며, 그 이유는 스몰토크에서 모든 스트림 연산(operations)이 이 모델에 기초하기 때 문입니다. 그러한 이유 때문에, 대부분의 스트림 클래스들은 PositionableStream의 서브클래스들입니다. 그림 10.1은 5개의 문자를 포함하고 있는 스트림을 제시합니다. 이 스트림은 예컨데 과거(past)에 아무 구성요소도 갖고 있지 않은, 그 자신의 위치에 놓여 있습니다. 여러분은 메시지 reset을 사용하여 이 위치를 다시 뒤로 돌릴 수 있습니다. <br />
[[image:_abcdeStef.png|none|910px|thumb|그림 10.1 시작 시점에, 위치를 잡은 스트림(Stream)]]<br />
<br />
<br />
구성요소를 개념적으로 읽는 것이 의미하는 것은 첫 번째 구성요소 시퀀스(the future element sequence)의 첫 번째 구성요소 시퀀스(the future element sequence)를 제거하는 것이고, 지난 구성요소 시퀀스(the past element sequence)뒤에 그것을 집어넣는다는 것입니다. <br />
<br />
<br />
메시지 next를 사용하여 하나의 구성요소를 읽은 후에, 여러분의 스트림(stream)의 상태는 그림 10.2에 나타납니다. <br />
[[image:a_bcdeStef.png|none|910px|thumb|그림 10.2: 메소드 next:의 실행 이후에 동일한 스트림(stream) ]]<br />
<br />
<br />
문자 b,c,d 그리고 e는 “미래에(in the future)”에 있는 반면에 문자 a는 “과거에(in the past)”에 있습니다. 구성요소를 작성(쓰기) 한다는 의미는 새로운 것으로 미래 시퀀스(the future sequence)의 첫 번째 구성요소를 대체하는 것이고, 과거(the past)로 그 구성요소를 이동시킨다는 것입니다. 그림 10.3은 메시지 nextPut:anElement를 사용하여 x를 쓰기 한 이후의 동일한 스트림(stream)의 상태를 보여 드리고 있습니다.<br />
[[image:ax_cdeStef.png|none|910px|thumb|그림 10.3: x에 쓰기 이후 동일한 스트림]]<br />
<br />
==Notes==<br />
<references /><br />
<br />
[[Category:SqueakByExample]]</div>Onionmixer