https://trans.onionmixer.net/mediawiki/index.php?title=SqueakByExample:8.4&feed=atom&action=history
SqueakByExample:8.4 - Revision history
2024-03-28T16:43:59Z
Revision history for this page on the wiki
MediaWiki 1.38.1
https://trans.onionmixer.net/mediawiki/index.php?title=SqueakByExample:8.4&diff=2050&oldid=prev
Onionmixer: 번역수정
2013-08-09T15:38:32Z
<p>번역수정</p>
<p><b>New page</b></p><div>==String==<br />
<br />
String 또한 Collection-String 카테고리에 정의되어 있습니다. 하나의 String 은 오직 character 들만 가지고 있는 색인화된 Collection 입니다.<br />
<br />
[[image:StringHierarchy.png|none|506px|thumb|그림 8.2: 문자열 계층도]]<br />
<br />
<br />
사실, String 은 추상클래스이며, 스퀵의 String 은 사실상 실제하는(concrete) 클래스 ByteString 의 인스턴스입니다.<br />
<br />
<syntaxhighlight lang="smalltalk"><br />
'hello world' class ⇒ ByteString<br />
</syntaxhighlight><br />
<br />
<br />
다른 중요한점은 String 의 서브클래스는 Symbol 이라는 것입니다. 중요한 차이점은 Symbol 의 인스턴스는 하나의 값에 대해 하나만 존재하다는 점이죠.(이는 때때로 "고유 인스턴스 속성" 으로 불리기도 합니다.) 한편 개별로 생성되었지만 우연히 같은 문자열을 가지는 String 은 서로 다른 객체인 경우도 종종 있습니다.<br />
<br />
<syntaxhighlight lang="smalltalk"><br />
'hel','lo' == 'hello' ⇒ false<br />
</syntaxhighlight><br />
<br />
<syntaxhighlight lang="smalltalk"><br />
('hel','lo') asSymbol == #hello ⇒ true<br />
</syntaxhighlight><br />
<br />
<br />
또다른 중요한 차이점은 Symbol 은 변경이 불가능하지만, String 은 변경이 가능하다는 점입니다.<br />
<br />
<syntaxhighlight lang="smalltalk"><br />
'hello' at: 2 put: $u; yourself ⇒ 'hullo'<br />
</syntaxhighlight><br />
<br />
<syntaxhighlight lang="smalltalk"><br />
#hello at: 2 put: $u ⇒ error<br />
</syntaxhighlight><br />
<br />
<br />
문자열들이 Collection 이라는 사실을 잊어버리기가 쉽습니다. 문자열들은 Collection 들이 이해하는것과 동일하게 메시지를 이해합니다:<br />
<br />
<syntaxhighlight lang="smalltalk"><br />
#hello indexOf: $o ⇒ 5<br />
</syntaxhighlight><br />
<br />
<br />
비록 String 이 Magnitude 에서 상속된 것은 아닙니다만, 일반적으로, 비교 메서드인 <, = 등을 지원합니다. 게다가, String>>match 는 기본적인 glob-style 패턴 비교에 유용합니다.<br />
<br />
<syntaxhighlight lang="smalltalk"><br />
'*or*' match: 'zorro' ⇒ true<br />
</syntaxhighlight><br />
<br />
<br />
정규 표현식에 사용할만한 보다 나은 지원이 필요하다면, Vassili Bykov 의 Regex 패키지같은 여러 가지 서드파티등을 활용할 수 있습니다.<br />
<br />
문자열은 여러가지 변환 메서드들을 지원합니다. 이 메서드 중 대부분은 asDate, asFileName 등과 같은 다른 클래스들을 위한 shortcut 생성자 메서드 입니다. capitalized 와 traslatetoLowercase 와 같이 문자열을 다른 문자열로 변환시키는 여러가지 유용한 메서드들도 있습니다.<br />
<br />
문자열과 컬렉션에 대한 좀 더 많은 정보를 원하시면, 9장을 보십시오.<br />
<br />
<br />
<br />
==Notes==<br />
<references /><br />
<br />
[[Category:SqueakByExample]]</div>
Onionmixer
https://trans.onionmixer.net/mediawiki/index.php?title=SqueakByExample:8.4&diff=2047&oldid=prev
Onionmixer at 05:11, 30 August 2012
2012-08-30T05:11:13Z
<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:11, 30 August 2012</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l39">Line 39:</td>
<td colspan="2" class="diff-lineno">Line 39:</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>비록 문자열이 메그니튜드(Magnitude)로부터 상속된 것은 아니지만, 보통, 비교 <del style="font-weight: bold; text-decoration: none;">메소드</del>(comparising methods) <, = 등을 지원합니다. 게다가, 문자열 »match은 몇몇 기본 방울 형식 패턴 매칭(basic glob-style pattern-mathing)에 유용합니다.</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>비록 문자열이 메그니튜드(Magnitude)로부터 상속된 것은 아니지만, 보통, 비교 <ins style="font-weight: bold; text-decoration: none;">메서드</ins>(comparising methods) <, = 등을 지원합니다. 게다가, 문자열 »match은 몇몇 기본 방울 형식 패턴 매칭(basic glob-style pattern-mathing)에 유용합니다.</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><syntaxhighlight lang="smalltalk"></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><syntaxhighlight lang="smalltalk"></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>'*or*' match: 'zorro' ⇒ true</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>'*or*' match: 'zorro' ⇒ true</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l47">Line 47:</td>
<td colspan="2" class="diff-lineno">Line 47:</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>레귤러 표현식들에 사용할 좀 더 고급 지원이 필요하시다면, Vassili Bykov의 Regex 패키지와 같은 여러 개의 제 3사 실행 지원들을 활용할 수 있습니다.</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>레귤러 표현식들에 사용할 좀 더 고급 지원이 필요하시다면, Vassili Bykov의 Regex 패키지와 같은 여러 개의 제 3사 실행 지원들을 활용할 수 있습니다.</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>문자열은 여러 개의 변환 <del style="font-weight: bold; text-decoration: none;">메소드들을 </del>지원합니다. 이 <del style="font-weight: bold; text-decoration: none;">메소들 </del>중 많은 것들은 asDate, asFileName 등과 같은 다른 클래스들을 위한 바로 가기 컨스트럭터 <del style="font-weight: bold; text-decoration: none;">메소드 </del>(shortcut constructor methods)입니다. capitalized와 traslatetoLowercase와 같은 문자열을 다른 문자열로 변환시키는 여러 개의 유용한 <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>문자열은 여러 개의 변환 <ins style="font-weight: bold; text-decoration: none;">메서드들을 </ins>지원합니다. 이 <ins style="font-weight: bold; text-decoration: none;">메서드 </ins>중 많은 것들은 asDate, asFileName 등과 같은 다른 클래스들을 위한 바로 가기 컨스트럭터 <ins style="font-weight: bold; text-decoration: none;">메서드 </ins>(shortcut constructor methods)입니다. capitalized와 traslatetoLowercase와 같은 문자열을 다른 문자열로 변환시키는 여러 개의 유용한 <ins style="font-weight: bold; text-decoration: none;">메서드 </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;"><div>문자열과 컬렉션에 대한 좀 더 많은 정보를 원하시면, 9장을 보십시오.</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>문자열과 컬렉션에 대한 좀 더 많은 정보를 원하시면, 9장을 보십시오.</div></td></tr>
</table>
Onionmixer
https://trans.onionmixer.net/mediawiki/index.php?title=SqueakByExample:8.4&diff=2046&oldid=prev
Onionmixer: SBE 문자열 페이지 추가
2012-08-16T10:47:55Z
<p>SBE 문자열 페이지 추가</p>
<p><b>New page</b></p><div>==문자열 (Strings)==<br />
<br />
문자열 또한 카테고리 Collection-String에서 정의됩니다. 하나의 문자열은(string) 오직 문자들만(characters) 붙잡고 있는(hold) 색인화된 컬렉션(indexed Collection)입니다.<br />
<br />
<br />
[[image:StringHierarchy.png|none|506px|thumb|그림 8.2: 문자열 계층도(The String Hierarchy)]]<br />
<br />
<br />
사실, 문자열(String)은 추상적(abstract)이고, 스퀵 문자열은 사실상 실체적 클래스(the concrete class) ByteString의 인스턴스입니다.<br />
<syntaxhighlight lang="smalltalk"><br />
'hello world' class ⇒ ByteString<br />
</syntaxhighlight><br />
<br />
<br />
다른 중요한 문자열(String)의 서브클래스는 심볼(Symbol)입니다. 중요한 차이는 주어진 값과 함께 지금까지 심볼(symbol)의 단일 인스턴스만 존재한다는 것입니다. [이것은 때때로 “고유한 인스턴스 속성(the unique instance property”로 지칭됩니다.) 반대로, 두 개의 분리 구성된 문자열(separately constructed String)은 종종 다른 오브젝트가 될 일련의 동일한 문자들을 포함할 수 있습니다. <br />
<syntaxhighlight lang="smalltalk"><br />
'hel','lo' == 'hello' ⇒ false<br />
</syntaxhighlight><br />
<br />
<syntaxhighlight lang="smalltalk"><br />
('hel','lo') asSymbol == #hello ⇒ true<br />
</syntaxhighlight><br />
<br />
<br />
다른 중요한 차이점은 심볼(symbol)이 변할 수 없는 반면에 문자열(String)은 변할 수 있다는 것입니다.<br />
<syntaxhighlight lang="smalltalk"><br />
'hello' at: 2 put: $u; yourself ⇒ 'hullo'<br />
</syntaxhighlight><br />
<br />
<syntaxhighlight lang="smalltalk"><br />
#hello at: 2 put: $u ⇒ error<br />
</syntaxhighlight><br />
<br />
<br />
문자열들이 컬렉션들(collections)이라는 사실을 잊어버리기가 쉽습니다. 문자열들은 컬렉션들이 이해하는 방식으로 동일한 메시지들을 이해합니다: <br />
<syntaxhighlight lang="smalltalk"><br />
#hello indexOf: $o ⇒ 5<br />
</syntaxhighlight><br />
<br />
<br />
비록 문자열이 메그니튜드(Magnitude)로부터 상속된 것은 아니지만, 보통, 비교 메소드(comparising methods) <, = 등을 지원합니다. 게다가, 문자열 »match은 몇몇 기본 방울 형식 패턴 매칭(basic glob-style pattern-mathing)에 유용합니다.<br />
<syntaxhighlight lang="smalltalk"><br />
'*or*' match: 'zorro' ⇒ true<br />
</syntaxhighlight><br />
<br />
<br />
레귤러 표현식들에 사용할 좀 더 고급 지원이 필요하시다면, Vassili Bykov의 Regex 패키지와 같은 여러 개의 제 3사 실행 지원들을 활용할 수 있습니다.<br />
<br />
문자열은 여러 개의 변환 메소드들을 지원합니다. 이 메소들 중 많은 것들은 asDate, asFileName 등과 같은 다른 클래스들을 위한 바로 가기 컨스트럭터 메소드 (shortcut constructor methods)입니다. capitalized와 traslatetoLowercase와 같은 문자열을 다른 문자열로 변환시키는 여러 개의 유용한 메소드 또한 존재합니다.<br />
<br />
문자열과 컬렉션에 대한 좀 더 많은 정보를 원하시면, 9장을 보십시오.<br />
<br />
==Notes==<br />
<references /><br />
<br />
[[Category:SqueakByExample]]</div>
Onionmixer