GnuSmalltalkUsersGuide:BaseChapter 032

From 흡혈양파의 번역工房
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
ClassDescription

ClassDescription

네임스페이스 Smalltalk에 정의됨

슈퍼클래스: Behavior

범주: 언어-구현


나의 인스턴스들은 클래스를 범주별로 접근하는 메서드를 제공하고, 클래스의 전체 범주를 외부 디스크 파일로 file out할 수 있도록 해준다.


ClassDescription: 컴파일하기

compile: code classified: categoryName

수신자 내에서 코드를 컴파일하고, 주어진 범주로 메서드를 할당하라. 새로 생성된 CompiledMethod를 응답하고, 오류가 발견될 경우 nil을 응답하라.

compile: code classified: categoryName ifError: block

메서드 범주, categoryName에 메서드 소스를 컴파일 및 설치하라. 파싱 오류가 발견되면 오류 블록 'block'을 호출하라 (compile:ifError: 참고). 메서드를 리턴하라.

compile: code classified: categoryName notifying: requestor

메서드 범주, categoryName에 메서드 소스를 컴파일 및 설치하라. 파싱 오류가 발견되면 요청자에게 오류 메시지를 전송하라.


ClassDescription: 변환

asClass

해당 메서드의 기능은 ClassDescription의 서브클래스에 의해 구현되어야 한다.

asMetaclass

수신자에 연관된 메타클래스를 응답하라.

binding

수신자를 값으로 가진 VariableBinding 객체를 응답하라.


ClassDescription: 복사하기

copy: selector from: aClass

aClass로부터 주어진 선택자를 복사하고 이를 동일한 범주에 할당하라.

copy: selector from: aClass classified: categoryName

aClass로부터 주어진 선택자를 복사하고 이를 동일한 범주에 할당하라.

copyAll: arrayOfSelectors from: class

arrayOfSelectors 안의 모든 선택자를 클래스로부터 복사하고, 클래스 내 선택자들과 같은 범주로 할당하라.

copyAll: arrayOfSelectors from: class classified: categoryName

arrayOfSelectors 안의 모든 선택자를 aClass로부터 복사하고, 주어진 범주에 할당하라.

copyAllCategoriesFrom: aClass

aClass 안의 모든 선택자를 복사하고 원래 범주에 할당하라.

copyCategory:categoryName from: aClass

aClass로부터 주어진 범주에 속하는 선택자를 모두 복사하라.

copyCategory:categoryName from: aClass classified: newCategoryName

aClass로부터 주어진 범주에 속하는 선택자를 모두 복사하고, 주어진 범주에 속하는 선택자로 재분류하라.


ClassDescription: 정리하기

fileOut: fileName

주어진 파일을 열고 파일에 전체 클래스 설명을 file out하라. Parser 패키지가 필요하다.

fileOutCategory:categoryName to: fileName

메서드 범주 categoryName에 속하는 모든 메서드를 filename 파일로 file out하라. Parser 패키지가 필요하다.

fileOutOn: aFileStream

전체 클래스 설명을 file out하라: 클래스 정의, 클래스 및 인스턴스 메서드. Parser 패키지가 필요하다.

fileOutSelector: selector to: fileName

주어진 선택자를 fileName으로 file out하라. Parser 패키지가 필요하다.


ClassDescription: 메시지와 클래스의 구성

classify: aSelector under: aString

선택자 aSelector가 식별한 메서드를 aString에 의해 주어진 범주로 넣어라.

createGetMethod: what

변수 'what'으로 접근하기 위한 메서드를 생성하라.

createGetMethod: what default: value

느긋한 초기화를 이용해 기본값 'value'로 변수 'what'에 접근하는 메서드를 생성하라.

createSetMethod: what

변수 'what'을 설정하는 메서드를 생성하라.

defineAsyncCFunc: cFuncNameString withSelectorArgs: selectorAndArgs args: argsArray

문서를 참고하라. 해당 함수는 사라졌으므로 특수 구문 <asyncCCall: ... >을 대신 사용해야 한다.

defineCFunc: cFuncNameString withSelectorArgs: selectorAndArgs returning: returnTypeSymbol args: argsArray

문서를 참고하라. 해당 함수는 사라졌으므로 특수 구문 <asyncCCall: ... >을 대신 사용해야 한다.

removeCategory:aString

주어진 범주에 속하는 메서드를 모두 수신자로부터 제거하라.

whichCategoryIncludesSelector: selector

주어진 선택자에 대한 범주를 응답하고, 선택자를 찾을 수 없다면 nil을 응답하라.


ClassDescription: 클래스 선언 파싱하기

addSharedPool: aDictionary

주어진 공유 풀을 클래스의 풀 dictionary 리스트로 추가하라.

import: aDictionary

주어진 공유 풀을 클래스의 풀 dictionary 리스트로 추가하라.


ClassDescription: 인쇄하기

classVariableString

해당 메서드의 기능은 ClassDescription의 서브클래스에 의해 구현되어야 한다.

instanceVariableString

수신자의 인스턴스 변수명을 포함하는 문자열을 응답하라.

nameIn: aNamespace

aNamespace에서 클래스를 참조할 때 클래스명을 응답하라.

printOn: aStream in: aNamespace

aNamespace에서 클래스를 참조할 때 클래스명을 aStream 상에 인쇄하라.

sharedVariableString

해당 메서드의 기능은 ClassDescription의 서브클래스에 의해 구현되어야 한다.


ClassDescription: 아직 분류되지 않음

fileOutCategory:category toStream: aFileStream

메서드 범주 category에 속한 메서드를 모두 aFileStream으로 file out하라. Parser 패키지가 필요하다.

fileOutSelector: aSymbol toStream: aFileStream

메서드 범주 category에 속한 메서드를 모두 aFileStream으로 file out하라. Parser 패키지가 필요하다.


Notes