Skip to content

Commit

Permalink
delete description about custom data constraint method
Browse files Browse the repository at this point in the history
  • Loading branch information
ValKmjolnir committed May 15, 2024
1 parent 95131b4 commit f4fccd9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 26 deletions.
13 changes: 0 additions & 13 deletions doc/4_godelscript_language.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -639,19 +639,6 @@ fn out() -> bool {
}
```

##### Custom Full Set Method

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.

```rust
impl File {
@data_constraint
fn extend_example() -> *File {
yield File {id: 1234567}
}
}
```

#### Constructing Anonymous Instances

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.
Expand Down
13 changes: 0 additions & 13 deletions doc/4_godelscript_language.md
Original file line number Diff line number Diff line change
Expand Up @@ -639,19 +639,6 @@ fn out() -> bool {
}
```

##### 自定义全集方法

`schema`允许使用不同于`__all__`名称的**静态方法**来表明一些集合也存在于该类型的全集中。该方法也必须包含特殊注解`@data_constraint`。该方法一般用于手动添加一些数据到该类型的全集中。

```rust
impl File {
@data_constraint
fn extend_example() -> *File {
yield File {id: 1234567}
}
}
```

#### 构造匿名实例

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

0 comments on commit f4fccd9

Please sign in to comment.