Skip to content

Commit f4fccd9

Browse files
committed
delete description about custom data constraint method
1 parent 95131b4 commit f4fccd9

File tree

2 files changed

+0
-26
lines changed

2 files changed

+0
-26
lines changed

doc/4_godelscript_language.en.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -639,19 +639,6 @@ fn out() -> bool {
639639
}
640640
```
641641

642-
##### Custom Full Set Method
643-
644-
A `schema` allows using static methods with different names than `__all__` to indicate that some sets also exist within its full set. This method must also contain the special annotation `@data_constraint`. This method is generally used to manually add some data to the full set of that type.
645-
646-
```rust
647-
impl File {
648-
@data_constraint
649-
fn extend_example() -> *File {
650-
yield File {id: 1234567}
651-
}
652-
}
653-
```
654-
655642
#### Constructing Anonymous Instances
656643

657644
GödelScript allows for the creation of anonymous instances with a specific syntax. The creation of anonymous instances is contingent on the instance existing within the full set of the `schema`, unless this usage appears within a `@data_constraint` method, in which case the result will be empty.

doc/4_godelscript_language.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -639,19 +639,6 @@ fn out() -> bool {
639639
}
640640
```
641641

642-
##### 自定义全集方法
643-
644-
`schema`允许使用不同于`__all__`名称的**静态方法**来表明一些集合也存在于该类型的全集中。该方法也必须包含特殊注解`@data_constraint`。该方法一般用于手动添加一些数据到该类型的全集中。
645-
646-
```rust
647-
impl File {
648-
@data_constraint
649-
fn extend_example() -> *File {
650-
yield File {id: 1234567}
651-
}
652-
}
653-
```
654-
655642
#### 构造匿名实例
656643

657644
GödelScript 允许用一个特定语法生成匿名实例。生成匿名实例的前提是该实例存在于该`schema`的全集中,除非该用法出现在`@data_constraint`方法中,否则结果为空。

0 commit comments

Comments
 (0)