docs: update contents

This commit is contained in:
Shunsuke Shibayama 2023-03-29 22:15:39 +09:00
parent 8a911c9c2c
commit b80234b066
23 changed files with 52 additions and 44 deletions

View file

@ -102,3 +102,7 @@ x: Int or NoneType
assert x != None
x: Int
```
<p align='center'>
<a href='./16_type.md'>Previous</a> | <a href='./18_iterator.md'>Next</a>
</p>

View file

@ -82,8 +82,8 @@ Types such as `Iterable` that provide an interface for handling traits (in this
---
<span id="1" style="font-size:x-small"><sup>1</sup> There doesn't seem to be a uniform name for this pattern, but in Rust, there is [companion struct pattern]( https://gist.github.com/qnighy/be99c2ece6f3f4b1248608a04e104b38# :~:text=%E3%82%8F%E3%82%8C%E3%81%A6%E3%81%84%E3%82%8B%E3%80%82-,companion%20struct,-%E3%83%A1%E3%82%BD%E3%83%83%E3%83%89%E3%81%A8%E3%80%81%E3 %81%9D%E3%81%AE), and was named after it. [](#f1) </span>
<span id="1" style="font-size:x-small"><sup>1</sup> There doesn't seem to be a uniform name for this pattern, but in Rust, there is [companion struct pattern](https://gist.github.com/qnighy/be99c2ece6f3f4b1248608a04e104b38#:~:text=%E3%82%8F%E3%82%8C%E3%81%A6%E3%81%84%E3%82%8B%E3%80%82-,companion%20struct,-%E3%83%A1%E3%82%BD%E3%83%83%E3%83%89%E3%81%A8%E3%80%81%E3%81%9D%E3%81%AE), and was named after it. [](#f1) </span>
<p align='center'>
<a href='./17_type.md'>Previous</a> | <a href='./18_mutability.md'>Next</a>
<a href='./17_narrowing.md'>Previous</a> | <a href='./19_mutability.md'>Next</a>
</p>

View file

@ -99,5 +99,5 @@ In C, types and functions cannot be assigned to variables; int and main are iden
However, in Erg, "everything is an object". Not only functions and types, but even operators can be assigned to variables.
<p align='center'>
<a href='./17_iterator.md'>Previous</a> | <a href='./19_ownership.md'>Next</a>
<a href='./18_iterator.md'>Previous</a> | <a href='./20_ownership.md'>Next</a>
</p>

View file

@ -104,5 +104,5 @@ However, such restrictions are a natural specification in languages withou
Erg is designed to prevent unintentional memory leaks, and will issue an error if the memory checker detects a circular reference. In most cases, this error can be resolved with a weak reference `Weak`. However, since it is not possible to generate objects with circular structures such as cyclic graphs, we plan to implement an API that can generate circular references as unsafe operations.
<p align='center'>
<a href='./18_mutability.md'>Previous</a> | <a href='./20_visibility.md'>Next</a>
<a href='./19_mutability.md'>Previous</a> | <a href='./21_visibility.md'>Next</a>
</p>

View file

@ -231,7 +231,7 @@ C = Class {.[<: C]i = Int}
```
<p align='center'>
<a href='./19_ownership.md'>Previous</a> | <a href='./21_naming_rule.md'>Next</a>
<a href='./20_ownership.md'>Previous</a> | <a href='./22_naming_rule.md'>Next</a>
</p>
---

View file

@ -46,5 +46,5 @@ Furthermore, literal identifiers can contain both symbols and spaces, so strings
```
<p align='center'>
<a href='./20_visibility.md'>Previous</a> | <a href='./22_lambda.md'>Next</a>
</p>
<a href='./21_visibility.md'>Previous</a> | <a href='./23_lambda.md'>Next</a>
</p>

View file

@ -91,5 +91,5 @@ id = |T| x: T -> x
```
<p align='center'>
<a href='./21_naming_rule.md'>Previous</a> | <a href='./23_subroutine.md'>Next</a>
<a href='./22_naming_rule.md'>Previous</a> | <a href='./24_subroutine.md'>Next</a>
</p>

View file

@ -58,5 +58,5 @@ and(x, y, z) = x and y and z
```
<p align='center'>
<a href='./22_lambda.md'>Previous</a> | <a href='./24_closure.md'>Next</a>
<a href='./23_lambda.md'>Previous</a> | <a href='./25_closure.md'>Next</a>
</p>

View file

@ -92,5 +92,5 @@ assert sum == 45
Erg is designed to be a natural succinct description of programming with immutable objects.
<p align='center'>
<a href='./23_subroutine.md'>Previous</a> | <a href='./25_module.md'>Next</a>
<a href='./24_subroutine.md'>Previous</a> | <a href='./26_module.md'>Next</a>
</p>

View file

@ -115,5 +115,5 @@ print! foo.x
In addition, An Erg module that is an entry point (i.e., a module that `__name__ == "__main__"`) cannot be the subject of circular references.
<p align='center'>
<a href='./24_closure.md'>Previous</a> | <a href='./26_object_system.md'>Next</a>
<a href='./25_closure.md'>Previous</a> | <a href='./27_object_system.md'>Next</a>
</p>

View file

@ -1,4 +1,6 @@
# Object
# Object System
## Object
All data that can be assigned to a variable. The attributes of the `Object` class are as follows.
@ -78,5 +80,5 @@ Objects that are not subroutines and types.
Monomorphic entities (`1`, `"a"`, etc.) are also called value objects, polymorphic entities (`[1, 2, 3], {"a": 1}`) are also called container objects .
<p align='center'>
<a href='./25_module.md'>Previous</a> | <a href='./27_pattern_matching.md'>Next</a>
<a href='./26_module.md'>Previous</a> | <a href='./28_pattern_matching.md'>Next</a>
</p>

View file

@ -191,5 +191,5 @@ There is no set pattern. Because the set has no way to uniquely retrieve the ele
You can retrieve them by iterator, but the order is not guaranteed.
<p align='center'>
<a href='./26_object_system.md'>Previous</a> | <a href='./28_comprehension.md'>Next</a>
<a href='./27_object_system.md'>Previous</a> | <a href='./29_comprehension.md'>Next</a>
</p>

View file

@ -61,5 +61,5 @@ Nat2D = {(I, J): (Int, Int) | I >= 0 and J >= 0}
```
<p align='center'>
<a href='./27_pattern_matching.md'>Previous</a> | <a href='./29_spread_syntax.md'>Next</a>
<a href='./28_pattern_matching.md'>Previous</a> | <a href='./30_spread_syntax.md'>Next</a>
</p>

View file

@ -37,5 +37,5 @@ assert x == 1 and y == 2
```
<p align='center'>
<a href='./28_comprehension.md'>Previous</a> | <a href='./30_decorator.md'>Next</a>
<a href='./29_comprehension.md'>Previous</a> | <a href='./31_decorator.md'>Next</a>
</p>

View file

@ -116,5 +116,5 @@ Indicates that the variable specification is obsolete and deprecated.
Indicates that this is a test subroutine. Test subroutines are run with the `erg test` command.
<p align='center'>
<a href='./29_spread_syntax.md'>Previous</a> | <a href='./31_error_handling.md'>Next</a>
<a href='./30_spread_syntax.md'>Previous</a> | <a href='./32_error_handling.md'>Next</a>
</p>

View file

@ -105,5 +105,5 @@ panic "something went wrong!"
```
<p align='center'>
<a href='./30_decorator.md'>Previous</a> | <a href='./32_pipeline.md'>Next</a>
<a href='./31_decorator.md'>Previous</a> | <a href='./33_pipeline.md'>Next</a>
</p>

View file

@ -28,5 +28,5 @@ __evens = 1..100 \
```
<p align='center'>
<a href='./31_error_handling.md'>Previous</a> | <a href='./33_integration_with_Python.md'>Next</a>
<a href='./32_error_handling.md'>Previous</a> | <a href='./34_integration_with_Python.md'>Next</a>
</p>

View file

@ -82,5 +82,5 @@ decl_proc proc!: Proc, T =
This is a runtime overhead, so [a project to statically type analyze Python scripts with Erg's type system](https://github.com/mtshiba/pylyzer) is underway.
<p align='center'>
<a href='./32_pipeline.md'>Previous</a> | <a href='./34_package_system.md'>Next</a>
<a href='./33_pipeline.md'>Previous</a> | <a href='./35_package_system.md'>Next</a>
</p>

View file

@ -84,5 +84,5 @@ baz = import "baz"
```
<p align='center'>
<a href='./33_integration_with_Python.md'>Previous</a> | <a href='./35_generator.md'>Next</a>
<a href='./34_integration_with_Python.md'>Previous</a> | <a href='./36_generator.md'>Next</a>
</p>

View file

@ -31,5 +31,5 @@ make_g: () => Generator!
```
<p align='center'>
<a href='./34_package_system.md'>Previous</a> | Next
<a href='./35_package_system.md'>Previous</a> | Next
</p>

View file

@ -61,26 +61,26 @@ This file is for generating The Erg Book. Do not add badges, etc.
- [Typeof, classof](./type/advanced/typeof.md)
- [Variance](./type/advanced/variance.md)
- [Type Widening](./type/advanced/widening.md)
- [Iterator](./17_iterator.md)
- [Mutability](./18_mutability.md)
- [Ownership system](./19_ownership.md)
- [Visibility](./20_visibility.md)
- [Naming convention](./21_naming_rule.md)
- [Anonymous function](./22_lambda.md)
- [Subroutine Signatures](./23_subroutine.md)
- [Closure](./24_closure.md)
- [Module](./25_module.md)
- [Object](./26_object_system.md)
- [pattern matching, refutable](./27_pattern_matching.md)
- [Comprehension](./28_comprehension.md)
- [Spread assignment](./29_spread_syntax.md)
- [Decorator (modifier)](./30_decorator.md)
- [error handling system](./31_error_handling.md)
- [Pipeline operator](./32_pipeline.md)
- [Integration with Python](./33_integration_with_Python.md)
- [Package System](./34_package_system.md)
- [Generator](./35_generator.md)
- [Type Narrowing](./17_narrowing.md)
- [Iterator](./18_iterator.md)
- [Mutability](./19_mutability.md)
- [Ownership system](./20_ownership.md)
- [Visibility](./21_visibility.md)
- [Naming convention](./22_naming_rule.md)
- [Anonymous function](./23_lambda.md)
- [Subroutine Signatures](./24_subroutine.md)
- [Closure](./25_closure.md)
- [Module](./26_module.md)
- [Object system](./27_object_system.md)
- [pattern matching, refutable](./28_pattern_matching.md)
- [Comprehension](./29_comprehension.md)
- [Spread assignment](./30_spread_syntax.md)
- [Decorator (modifier)](./31_decorator.md)
- [error handling](./32_error_handling.md)
- [Pipeline operator](./33_pipeline.md)
- [Integration with Python](./34_integration_with_Python.md)
- [Package System](./35_package_system.md)
- [Generator](./36_generator.md)
- [The Grammar of Erg (ver 0.1.0, provisional)](./grammar.md)
- [index](./indexes.md)
- [Type Narrowing](./narrowing.md)
- [Quick Tour](./quick_tour.md)

View file

@ -1,7 +1,9 @@
# 対象体
# オブジェクトシステム
[![badge](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fgezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com%2Fdefault%2Fsource_up_to_date%3Fowner%3Derg-lang%26repos%3Derg%26ref%3Dmain%26path%3Ddoc/EN/syntax/26_object_system.md%26commit_hash%3D8673a0ce564fd282d0ca586642fa7f002e8a3c50)](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/syntax/26_object_system.md&commit_hash=8673a0ce564fd282d0ca586642fa7f002e8a3c50)
## オブジェクト(対象体)
変数に代入できる全てのデータです。`Object`クラスの持つ属性は以下の通りです。
* `.__repr__`: オブジェクトの(リッチでない)文字列表現を返します

View file

@ -1,4 +1,4 @@
# エラーハンドリングシステム
# エラーハンドリング
[![badge](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fgezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com%2Fdefault%2Fsource_up_to_date%3Fowner%3Derg-lang%26repos%3Derg%26ref%3Dmain%26path%3Ddoc/EN/syntax/31_error_handling.md%26commit_hash%3De959b3e54bfa8cee4929743b0193a129e7525c61)](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/syntax/31_error_handling.md&commit_hash=e959b3e54bfa8cee4929743b0193a129e7525c61)