Factor Language: Tuples






Tuples are user-defined classes composed of named slots. They are the central data type of Factor's object system.
Tuple들은 이다 사용자 정의된 클래스들 구성된 관련된 것은 이름지어진 slot들. 그들은 이다 중심 데이터 유형 관련된 것은 Factor의 객체 시스템.
Tuple examples

A parsing word defines tuple classes:
파싱 워드는 정의한다 tuple 클래스들.


TUPLE:


For each tuple class, several words are defined, the class word, a class predicate, and accessor words for each slot.
위하는 것은 각 tuple 클래스, 다양한 워드들이 정의된, 그 클래스 워드, 한 클래스 술어, 그리고 접근자 워드들 위하는 것은 각 slot.

The class word is used for defining methods on the tuple class; it has the same name as the tuple class.
클래스 워드는 사용된다 위하는 것은 정의하는 메소드들 접하는 것은 tuple 클래스; 그것은 가진다 같은 이름 동시에 같은 것은 tuple 클래스.
The predicate is named name?.
술러는 이름지어진다 name?.
Initially, no specific words are defined for constructing new instances of the tuple.
초기에, 없다 특정한 워드들 정의된다 위하는 것은 생성 새로운 인스턴스들 관련된 것은 그 tuple.
Constructors must be defined explicitly, and tuple slots are accessed via automatically-generated accessor words.
생성자들은 정의되어야 한다 명시적으로, 그리고 tuple slot들은 접근되된다 통해서 자동적으로 생성된 접근 워드들.
Slot accessors
Tuple constructors
Tuple subclassing
Tuple slot declarations
Protocol slots
Tuple introspection

Tuple classes can be redefined; this updates existing instances:
Tuple 클래스들은 할 수있다 재저의되다; 이것은 수정한다 존재하는 인스턴스들:
Tuple redefinition

Tuple literal syntax is documented in Tuple syntax.

댓글

이 블로그의 인기 게시물

Publish to my blog (weekly)

Publish to my blog (weekly)