mirror of
https://github.com/erg-lang/erg.git
synced 2025-10-02 05:31:11 +00:00
Merge pull request #97 from GreasySlug/feature-put-badges
Added badges to check if a document has been updated
This commit is contained in:
commit
166831dba4
83 changed files with 209 additions and 0 deletions
|
@ -1,5 +1,7 @@
|
|||
# Branch naming and operation policy
|
||||
|
||||
[](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/dev_guide/branches.md&commit_hash=bd59088c51941b5336e2115189579171d8086929)
|
||||
|
||||
* Basically, development is done on a single `main` branch (monorepo development). Create a `feature-*` or `issue-*` branch only if it is difficult to work without a separate branch.
|
||||
|
||||
## main
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# `erg` build features
|
||||
|
||||
[](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/dev_guide/build_features.md&commit_hash=bd59088c51941b5336e2115189579171d8086929)
|
||||
|
||||
## debug
|
||||
|
||||
Put into debug mode. This will log the behavior of Erg internally as it happens.
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# Directory Structure of Erg
|
||||
|
||||
[](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/dev_guide/directories.md&commit_hash=0b54ef3b40923a3480e59b04e8b010b050e3086c)
|
||||
|
||||
```console
|
||||
└─┬ assets: images
|
||||
├─ CODE_OF_CONDUCT: Code of Conduct
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# format
|
||||
|
||||
[](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/dev_guide/doc_guideline.md&commit_hash=3b9be7ad98476f68859ef0deeb5adb24f4155068)
|
||||
|
||||
Any document that does not follow the rules below is subject to correction.
|
||||
|
||||
* Always include definitions, meanings, or links to terms that appear for the first time in the document.
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# Development Environment
|
||||
|
||||
[](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/dev_guide/env.md&commit_hash=80b0b20936126c4886372b10120b8026aecea98a)
|
||||
|
||||
## Need to install
|
||||
|
||||
* Rust (installed with rustup)
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# Multilingualization of Messages
|
||||
|
||||
[](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/dev_guide/i18n_messages.md&commit_hash=842fe1035323c5962f76ce10c595ce0d90c6bf04)
|
||||
|
||||
Erg is working on making all messages (start, option, doc, hint, warning, error messages, etc.) multilingual within the language.
|
||||
This project is open to anyone without detailed knowledge of Rust or Erg. Your participation is always welcome.
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# Guidelines for Rust code
|
||||
|
||||
[](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/dev_guide/rust_code_guideline.md&commit_hash=bd59088c51941b5336e2115189579171d8086929)
|
||||
|
||||
## Local rules
|
||||
|
||||
* Use `log!` for debugging output (use `println!` etc. for output processing required for release).
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# Erg FAQ
|
||||
|
||||
[
|
||||
](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/faq_general.md&commit_hash=fd4afc4fe1f302e11d48a9168b8aaa6b6d7dfbf4)
|
||||
|
||||
This FAQ is intended for the general Erg beginner.
|
||||
For individual (common) technical issues, please refer to [here](./faq_technical.md) for individual (common) technical issues, and
|
||||
[Here](./dev_guide/faq_syntax.md) for more information.
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
# Technical FAQ
|
||||
|
||||
[
|
||||
](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/faq_technical.md&commit_hash=6ddef21fec8da781f9967eaf9c1b13c6a1c5607b)
|
||||
|
||||
|
||||
This section answers technical questions about using the Erg language. In other words, it contains questions that begin with What or Which, and questions that can be answered with Yes/No.
|
||||
|
||||
For more information on how the grammar was determined, see [here](./dev_guide/faq_syntax.md) for the underlying syntax decisions, and [here](./dev_guide/../faq_general.md).
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# Improvements from Python
|
||||
|
||||
[
|
||||
](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/faq_technical.md&commit_hash=6ddef21fec8da781f9967eaf9c1b13c6a1c5607b)
|
||||
|
||||
## Perform static analysis (static type checking, variable and property checking)
|
||||
|
||||
The benefit of static type checking cannot be emphasized enough now, but checking for the existence of variables and properties is also a part that comes into play quite a bit.
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# Index
|
||||
|
||||
[
|
||||
](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/index.md&commit_hash=96132b20f6efb8fab884195f7f5144dc87e20be1)
|
||||
|
||||
## [API/](./API/index.md)
|
||||
|
||||
This section describes the specifications of subroutines, types, constants, etc. provided by Erg's built-in or standard libraries.
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# Tips on migrating from Python to Erg
|
||||
|
||||
[
|
||||
](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/migration_from_py.md&commit_hash=96132b20f6efb8fab884195f7f5144dc87e20be1)
|
||||
|
||||
## Want to convert a string to an int, etc
|
||||
|
||||
Use the `parse` method of the `Str` class. It returns a `Result` type.
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# Basics
|
||||
|
||||
[
|
||||
](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/00_basic.md&commit_hash=bccb88f8845839b36bc8e0f2f0335f7c6a54dd54)
|
||||
|
||||
> __Info__: This document is incomplete. It has not been proofread (style, correct links, mistranslation, etc.). Also, Erg's syntax may be change destructively during version 0.*, and the documentation may not have been updated accordingly. Please be aware of this beforehand.
|
||||
> If you find any errors in this document, please report then to [here form](https://forms.gle/HtLYRfYzWCAaeTGb6) or [GitHub repo](https://github.com/mtshiba/TheErgBook/issues/new). We would appreciate your suggestions.
|
||||
>
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# Literal
|
||||
|
||||
[
|
||||
](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/01_literal.md&commit_hash=6dc8c5015b6120497a26d80eaef65d23eb2bee2a)
|
||||
|
||||
## Basic Literals
|
||||
|
||||
### Int Literal
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# Variable
|
||||
|
||||
[
|
||||
](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/02_name.md&commit_hash=6dc8c5015b6120497a26d80eaef65d23eb2bee2a)
|
||||
|
||||
Variables are a type of algebra; algebra in Erg - sometimes simply referred to as variable if there is no confusion - refers to the feature to name objects and make them referable from elsewhere in the code.
|
||||
|
||||
A variable is defined as follows.
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# Declaration
|
||||
|
||||
[
|
||||
](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/03_declaration.md&commit_hash=79a1f4904f563052caeae5127e030420f844cc23)
|
||||
|
||||
Declaration is the syntax for specifying the type of variable to be used.
|
||||
Declarations can be made anywhere in the code, but declarations alone do not refer to the variables. They must be initialized.
|
||||
After the assignment, the declaration can be checked to ensure that the type is compatible with the object to which it is assigned.
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# Function
|
||||
|
||||
[
|
||||
](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/04_function.md&commit_hash=c4b61bb14d6a9affeb55a99c99beabc573604073)
|
||||
|
||||
A function is a block that takes an "argument", processes it, and returns it as a "return value". It is defined as follows.
|
||||
|
||||
```erg
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# Built-in functions
|
||||
|
||||
[
|
||||
](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/05_buildtin_funcs.md&commit_hash=6dc8c5015b6120497a26d80eaef65d23eb2bee2a)
|
||||
|
||||
## if
|
||||
|
||||
`if` is a function that changes processing depending on a condition.
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# operator
|
||||
|
||||
[
|
||||
](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/06_operator.md&commit_hash=96132b20f6efb8fab884195f7f5144dc87e20be1)
|
||||
|
||||
Operators are symbols that represent operations. Operands are things to the (left) right of an operator.
|
||||
|
||||
Operators are a kind of function, and thus are themselves first-class objects that can be bound to variables. When binding, it is necessary to enclose it with ``.
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# Side effects and procedures
|
||||
|
||||
[
|
||||
](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/07_side_effect.md&commit_hash=6dc8c5015b6120497a26d80eaef65d23eb2bee2a)
|
||||
|
||||
We have been neglecting to explain the meaning of the `!`, but now its meaning will finally be revealed. This `!` indicates that this object is a "procedure" with a "side-effect". A procedure is a function with a side-effect.
|
||||
|
||||
```erg
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# Procedures
|
||||
|
||||
[
|
||||
](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/08_procedure.md&commit_hash=96132b20f6efb8fab884195f7f5144dc87e20be1)
|
||||
|
||||
Procedures are necessary when dealing with mutable objects, but having a mutable object as an argument does not necessarily make it a procedure.
|
||||
Here is a function takes a mutable object (not procedure).
|
||||
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# Built-in procedure
|
||||
|
||||
[
|
||||
](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/09_buildtin_procs.md&commit_hash=6dc8c5015b6120497a26d80eaef65d23eb2bee2a)
|
||||
|
||||
## id!
|
||||
|
||||
Returns the unique identification number of the object.
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# Array
|
||||
|
||||
[
|
||||
](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/10_array.md&commit_hash=6c6afe84d1dc05ee7566b46c12d39b8c49a3acfb)
|
||||
|
||||
Arrays are the most basic __collection (aggregate)__.
|
||||
A collection is an object that can hold multiple objects inside it.
|
||||
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# Tuple
|
||||
|
||||
[
|
||||
](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/11_tuple.md&commit_hash=6dc8c5015b6120497a26d80eaef65d23eb2bee2a)
|
||||
|
||||
Tuples are similar to arrays, but can hold objects of different types.
|
||||
Such a collection is called an unequal collection. In contrast, homogeneous collections include arrays, sets, etc.
|
||||
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# Dict
|
||||
|
||||
[
|
||||
](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/12_dict.md&commit_hash=7a2f59795bc983f2fd0daf9732f32d59bd8e9c59)
|
||||
|
||||
Dict is a collection of key/value pairs.
|
||||
|
||||
```erg
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# Record
|
||||
|
||||
[
|
||||
](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/13_record.md&commit_hash=d0b86d83008bf79091b36763bec5a3f4b9f7c5ec)
|
||||
|
||||
A record is a collection that combines the properties of a Dict accessed by key and a tuple whose access is inspected at compile time.
|
||||
If you know JavaScript, think of it as a (more enhanced) kind of object literal notation.
|
||||
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# Set
|
||||
|
||||
[
|
||||
](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/14_set.md&commit_hash=6dc8c5015b6120497a26d80eaef65d23eb2bee2a)
|
||||
|
||||
A set is an unordered array with no duplicates.
|
||||
|
||||
```erg
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# types
|
||||
|
||||
[
|
||||
](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/15_type.md&commit_hash=96132b20f6efb8fab884195f7f5144dc87e20be1)
|
||||
|
||||
Types are a very important feature in Erg, so we have a [dedicated section](./type/01_type_system.md). Please see there.
|
||||
|
||||
<p align='center'>
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# Iterator
|
||||
|
||||
[
|
||||
](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/16_iterator.md&commit_hash=96132b20f6efb8fab884195f7f5144dc87e20be1)
|
||||
|
||||
An iterator is an object used to retrieve elements of a container.
|
||||
|
||||
```erg
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# Mutability
|
||||
|
||||
[
|
||||
](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/17_mutability.md&commit_hash=6c6afe84d1dc05ee7566b46c12d39b8c49a3acfb)
|
||||
|
||||
As we have already seen, all Erg variables are immutable. However, Erg objects have the concept of mutability.
|
||||
Take the following code as an example.
|
||||
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# Ownership System
|
||||
|
||||
[
|
||||
](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/18_ownership.md&commit_hash=a84ab773d007af040d8ad1854bbeb38d136d9c46)
|
||||
|
||||
Since Erg is a language that uses Python as its host language, its method of memory management is dependent on the Python implementation.
|
||||
Semantically, however, Erg's memory management is different from that of Python. The most noticeable differences appear in the ownership system and the prohibition of circular references.
|
||||
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# Visibility
|
||||
|
||||
[
|
||||
](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/19_visibility.md&commit_hash=6c6afe84d1dc05ee7566b46c12d39b8c49a3acfb)
|
||||
|
||||
Erg variables have the concept of __visibility__.
|
||||
All variables we have seen so far are called __private variables__. These are variables that are invisible to the outside world.
|
||||
For example, a private variable defined in the `foo` module cannot be referenced from another module.
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# Naming Conventions
|
||||
|
||||
[
|
||||
](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/20_naming_rule.md&commit_hash=3D6dc8c5015b6120497a26d80eaef65d23eb2bee2a)
|
||||
|
||||
If a variable is to be used as a constant expression, it must begin with a capital letter. The second and succeeding letters may be in lowercase.
|
||||
|
||||
```erg
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# Anonymous Function
|
||||
|
||||
[
|
||||
](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/21_lambda.md&commit_hash=6dc8c5015b6120497a26d80eaef65d23eb2bee2a)
|
||||
|
||||
An anonymous function is a syntax for creating function objects on the fly without naming them.
|
||||
|
||||
```erg
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# Subroutine Signatures
|
||||
|
||||
[
|
||||
](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/22_subroutine.md&commit_hash=6c6afe84d1dc05ee7566b46c12d39b8c49a3acfb)
|
||||
|
||||
## Func
|
||||
|
||||
```erg
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# Closure
|
||||
|
||||
[
|
||||
](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/23_closure.md&commit_hash=6dc8c5015b6120497a26d80eaef65d23eb2bee2a)
|
||||
|
||||
Erg subroutines have a "closure" feature that captures external variables.
|
||||
|
||||
```erg
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# module
|
||||
|
||||
[
|
||||
](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/24_module.md&commit_hash=0c3f19f27ac0f39b82db2d7e17e746b651895778)
|
||||
|
||||
Erg allows you to think of the file itself as a single record. This is called a module.
|
||||
|
||||
```erg: foo.er
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# Object
|
||||
|
||||
[
|
||||
](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/25_object_system.md&commit_hash=6c6afe84d1dc05ee7566b46c12d39b8c49a3acfb)
|
||||
|
||||
All data that can be assigned to a variable. The `Object` class has the following attributes.
|
||||
|
||||
* `. __repr__`: returns a (non-rich) string representation of the object.
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# Pattern matching, Irrefutability
|
||||
|
||||
[
|
||||
](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_pattern_matching.md&commit_hash=6dc8c5015b6120497a26d80eaef65d23eb2bee2a)
|
||||
|
||||
## Patterns Available in Erg
|
||||
|
||||
### Variable Pattern
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# Comprehension
|
||||
|
||||
[
|
||||
](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/27_comprehension.md&commit_hash=6dc8c5015b6120497a26d80eaef65d23eb2bee2a)
|
||||
|
||||
An array can be created by `[expr | (name <- iterable)+ (predicate)*]`,
|
||||
And a set can be created by `{expr | (name <- iterable)+ (predicate)*}`.
|
||||
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# Spread assignment
|
||||
|
||||
[
|
||||
](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/28_spread_syntax.md&commit_hash=6dc8c5015b6120497a26d80eaef65d23eb2bee2a)
|
||||
|
||||
In a spread assignment, a variable can be prefixed with `...` in front of the variable, all the remaining elements can be expanded into the variable. This is called a spread assignment.
|
||||
|
||||
```erg
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# Decorator
|
||||
|
||||
[
|
||||
](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/29_decorator.md&commit_hash=417bfcea08ed0e09f715f5d272842510fca8f6dd)
|
||||
|
||||
Decorators are used to add or make explicit a specific state or behavior for a type or function.
|
||||
The syntax for decorators is as follows.
|
||||
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# Error Handling
|
||||
|
||||
[
|
||||
](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/30_error_handling.md&commit_hash=6dc8c5015b6120497a26d80eaef65d23eb2bee2a)
|
||||
|
||||
Mainly uses Result type.
|
||||
Erg will throw away Error type objects (not supported at top level).
|
||||
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# Pipeline Operator
|
||||
|
||||
[
|
||||
](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_pipeline.md&commit_hash=a84ab773d007af040d8ad1854bbeb38d136d9c46)
|
||||
|
||||
The pipeline operator is used like this:
|
||||
|
||||
``` erg
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# Integration with Python
|
||||
|
||||
[
|
||||
](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/32_integration_with_Python.md&commit_hash=7270b3f1541be0422fc46e1f533259738333c7d1)
|
||||
|
||||
## Export to Python
|
||||
|
||||
When the Erg script is compiled, a .pyc file is generated, which can simply be imported as a Python module.
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# Package System
|
||||
|
||||
[
|
||||
](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/33_package_system.md&commit_hash=6dc8c5015b6120497a26d80eaef65d23eb2bee2a)
|
||||
|
||||
Erg packages can be roughly classified into the app package, which is the application, and the lib package, which is the library.
|
||||
The entry point of the app package is `src/app.er`. The `main` function defined in `app.er` is executed.
|
||||
The entry point for the lib package is `src/lib.er`. Importing a package is equivalent to importing `lib.er`.
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# Generator
|
||||
|
||||
[
|
||||
](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/34_generator.md&commit_hash=6dc8c5015b6120497a26d80eaef65d23eb2bee2a)
|
||||
|
||||
Generators are special procedures that use the `yield!` procedure in a block.
|
||||
|
||||
```erg
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# Erg's Type System
|
||||
|
||||
[](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/type/01_type_system.md&commit_hash=417bfcea08ed0e09f715f5d272842510fca8f6dd)
|
||||
|
||||
The following is a brief description of Erg's type system. Details are explained in other sections.
|
||||
|
||||
## How to define
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# Basic syntax for types
|
||||
|
||||
[](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/type/02_basic.md&commit_hash=7c27021e16bea953bdc4da8e0c60e2f3b1ad8571)
|
||||
|
||||
## Type specification
|
||||
|
||||
In Erg, the type of a variable can be specified after `:` as follows. This can be done at the same time as an assignment.
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# Trait
|
||||
|
||||
[](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/type/03_trait.md&commit_hash=7c27021e16bea953bdc4da8e0c60e2f3b1ad8571)
|
||||
|
||||
Trait is a nominal type that adds a type attribute requirement to record types.
|
||||
It is similar to the Abstract Base Class (ABC) in Python, but with the distinction of being able to perform algebraic operations.
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# Class
|
||||
|
||||
[](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/type/04_class.md&commit_hash=18591823f1781e3f2b6e7ed80ca57ccd39a76c7a)
|
||||
|
||||
A class in Erg is roughly a type that can create its own elements (instances).
|
||||
Here is an example of a simple class.
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# Inheritance
|
||||
|
||||
[](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/type/05_inheritance.md&commit_hash=d0b86d83008bf79091b36763bec5a3f4b9f7c5ec)
|
||||
|
||||
Inheritance allows you to define a new class that adds functionality or specialization to an existing class.
|
||||
Inheritance is similar to inclusion in a trace. The inherited class becomes a subtype of the original class.
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# Nominal Subtyping vs. Structural Subtyping
|
||||
|
||||
[](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/type/06_nst_vs_sst.md&commit_hash=d0b86d83008bf79091b36763bec5a3f4b9f7c5ec)
|
||||
|
||||
```erg
|
||||
Months = 0..12
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# Patch
|
||||
|
||||
[](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/type/07_patch.md&commit_hash=d0b86d83008bf79091b36763bec5a3f4b9f7c5ec)
|
||||
|
||||
Erg does not allow modification of existing types and classes.
|
||||
This means, it is not possible to define additional methods in a class, nor to perform specialization (a language feature that monomorphizes a polymorphically declared type and defines a dedicated method, as in C++).
|
||||
However, there are many situations where you may want to add feature to an existing type or class, and there is a function called "patching" that allows you to do this.
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# Value Type
|
||||
|
||||
[](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/type/08_value.md&commit_hash=HASH_TEMPLATE)
|
||||
|
||||
Value types are Erg built-in types that can be evaluated at compile time, specifically:
|
||||
|
||||
``` erg
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# Attributive Type
|
||||
|
||||
[](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/type/09_attributive.md&commit_hash=ae6d00168c17428bf967e44db3e6360e2471df8b)
|
||||
|
||||
Attribute types are types that contain Record and Dataclass, Patch, Module, etc.
|
||||
Types belonging to attribute types are not value types.
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# Interval Type
|
||||
|
||||
[](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/type/10_interval.md&commit_hash=ae6d00168c17428bf967e44db3e6360e2471df8b)
|
||||
|
||||
The most basic use of `Range` objects is as iterator.
|
||||
|
||||
```erg
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# Enumerative Type
|
||||
|
||||
[](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/type/11_enum.md&commit_hash=ae6d00168c17428bf967e44db3e6360e2471df8b)
|
||||
|
||||
Enum types generated by Set.
|
||||
Enum types can be used as-is with type specifications, but further methods can be defined by classifying them into classes or defining patches.
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# Refinement Type
|
||||
|
||||
[](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/type/12_refinement.md&commit_hash=96132b20f6efb8fab884195f7f5144dc87e20be1)
|
||||
|
||||
Refinement type is a type constrained by a predicate expression. Enumeration types and interval types are syntax sugar of refinement types.
|
||||
|
||||
The standard form of a refinement type is `{Elem: Type | (Pred)*}`. This means that the type is a type whose elements are `Elem` satisfying `Pred`.
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# Algebraic type
|
||||
|
||||
[](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/type/13_algebraic.md&commit_hash=ae6d00168c17428bf967e44db3e6360e2471df8b)
|
||||
|
||||
Algebraic types are types that are generated by operating types by treating them like algebra.
|
||||
Operations handled by them include Union, Intersection, Diff, Complement, and so on.
|
||||
Normal classes can only perform Union, and other operations will result in a type error.
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# Dependent Types
|
||||
|
||||
[](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/type/14_dependent.md&commit_hash=96132b20f6efb8fab884195f7f5144dc87e20be1)
|
||||
|
||||
Dependent types are one of the most important features of Erg.
|
||||
Dependent types are types that take values as arguments. Normal polymorphic types can take only types as arguments, but dependent types loosen that restriction.
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# Type Variable, quantified type
|
||||
|
||||
[](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/type/15_quantified.md&commit_hash=96132b20f6efb8fab884195f7f5144dc87e20be1)
|
||||
|
||||
A type variable is a variable used, for example, to specify the type of subroutine arguments, and its type is arbitrary (not monomorphic).
|
||||
First, as motivation for introducing type variables, consider the `id` function, which returns input as is.
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# Subtyping
|
||||
|
||||
[](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/type/16_subtyping.md&commit_hash=2ce482b1c8407332b3b74f4c3e5596f373f9a657)
|
||||
|
||||
In Erg, class inclusion can be determined with the comparison operators `<`, `>`.
|
||||
|
||||
```erg
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# Cast
|
||||
|
||||
[](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/type/17_type_casting.md&commit_hash=2ce482b1c8407332b3b74f4c3e5596f373f9a657)
|
||||
|
||||
## Upcasting
|
||||
|
||||
Because Python is a language that uses duck typing, there is no concept of casting. There is no need to upcast, and there is essentially no downcasting.
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# Mutable Type
|
||||
|
||||
[](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/type/18_mut.md&commit_hash=c4d2f5f4f83d8c3236fda57d14c3b375d438098f)
|
||||
|
||||
> __Warning__: The information in this section is out of date and contains some errors.
|
||||
|
||||
In Erg, by default, all types are immutable, i.e., their internal state cannot be updated.
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# Type Bound
|
||||
|
||||
[](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/type/19_bound.md&commit_hash=417bfcea08ed0e09f715f5d272842510fca8f6dd)
|
||||
|
||||
A type boundary is a condition on the type specification. The guard (guard clause) is the function that makes this possible.
|
||||
In addition to function signatures and anonymous function signatures, sieve types can also use this feature.
|
||||
The guard is described after the return type.
|
||||
|
|
|
@ -1 +1,4 @@
|
|||
The following sections describe more advanced type systems. Beginners do not need to read the entire section.
|
||||
|
||||
[](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/type/advanced.md&commit_hash=2ce482b1c8407332b3b74f4c3e5596f373f9a657)
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# Generalized Algebraic Data Types (GADTs)
|
||||
|
||||
[](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/type/advanced/GADTs.md&commit_hash=417bfcea08ed0e09f715f5d272842510fca8f6dd)
|
||||
|
||||
Erg can create Generalized Algebraic Data Types (GADTs) by classifying Or (Union) types.
|
||||
|
||||
```erg
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# Function type with default parameter
|
||||
|
||||
[](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/type/advanced/default_param.md&commit_hash=417bfcea08ed0e09f715f5d272842510fca8f6dd)
|
||||
|
||||
First, let's look at an example of the use of default parameters.
|
||||
|
||||
```erg
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# Type erasure
|
||||
|
||||
[](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/type/advanced/erasure.md&commit_hash=417bfcea08ed0e09f715f5d272842510fca8f6dd)
|
||||
|
||||
Type erasure is the process of setting a type argument to `_` and deliberately discarding its information. Type erasure is a feature of many polymorphic languages, but in the context of Erg's syntax, it is more accurate to call it type argument erasure.
|
||||
|
||||
The most common example of a type that has been type-erased is `[T, _]`. Arrays are not always known their length at compile-time. For example, `sys.argv`, which refers to command line arguments, is of type `[Str, _]`. Since Erg's compiler has no way of knowing the length of command line arguments, information about their length must be given up.
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# Existential type
|
||||
|
||||
[](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/type/advanced/existential.md&commit_hash=417bfcea08ed0e09f715f5d272842510fca8f6dd)
|
||||
|
||||
If there is a for-all type corresponding to ∀, it is natural to assume that there is an existential type corresponding to ∃.
|
||||
Existential types are not difficult. You already know the existential type, just not consciously aware of it as such.
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# Function type with keyword arguments
|
||||
|
||||
[](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/type/advanced/keyword_param.md&commit_hash=417bfcea08ed0e09f715f5d272842510fca8f6dd)
|
||||
|
||||
```erg
|
||||
h(f) = f(y: 1, x: 2)
|
||||
h: |T: Type|((y: Int, x: Int) -> T) -> T
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# Kind
|
||||
|
||||
[](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/type/advanced/kind.md&commit_hash=417bfcea08ed0e09f715f5d272842510fca8f6dd)
|
||||
|
||||
Everything is typed in Erg. Types themselves are no exception. __kind__ represents the “type of type”. For example, `Int` belongs to `Type`, just as `1` belongs to `Int`. `Type` is the simplest kind, the __atomic kind__. In type-theoretic notation, `Type` corresponds to `*`.
|
||||
|
||||
In the concept of kind, what is practically important is one or more kinds (multinomial kind). One-term kind, for example `Option`, belongs to it. A unary kind is represented as `Type -> Type` [<sup id="f1">1</sup>](#1). A __container__ such as `Array` or `Option` is specifically a polynomial kind that takes a type as an argument.
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# Marker Trait
|
||||
|
||||
[](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/type/advanced/marker_trait.md&commit_hash=417bfcea08ed0e09f715f5d272842510fca8f6dd)
|
||||
|
||||
A marker trait is a trait with no required attributes. That is, it can be Impl without implementing a method.
|
||||
It may seem meaningless without the required attribute, but it registers the information that it belongs to that trait, so that patch methods can be used and the compiler can give it special treatment.
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# Mutable Structure Type
|
||||
|
||||
[](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/type/advanced/mut_struct.md&commit_hash=417bfcea08ed0e09f715f5d272842510fca8f6dd)
|
||||
|
||||
The ``T!`` type is described as a box type that can be replaced by any ``T`` type object.
|
||||
|
||||
```erg
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# Newtype pattern
|
||||
|
||||
[](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/type/advanced/newtype.md&commit_hash=417bfcea08ed0e09f715f5d272842510fca8f6dd)
|
||||
|
||||
Here is the Erg version of the newtype pattern commonly used in Rust.
|
||||
|
||||
Erg allows type aliases to be defined as follows, but they only refer to the same type.
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# Overloading
|
||||
|
||||
[](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/type/advanced/overloading.md&commit_hash=417bfcea08ed0e09f715f5d272842510fca8f6dd)
|
||||
|
||||
Erg does not support __ad hoc polymorphism__. That is, multiple definitions of functions and Kinds (overloading) are not possible. However, you can reproduce the overloading behavior by using a combination of a trace class and a patch.
|
||||
You can use traits instead of trait classes, but then all types that implement `.add1` will be covered.
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# Phantom class
|
||||
|
||||
[](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/type/advanced/phantom.md&commit_hash=417bfcea08ed0e09f715f5d272842510fca8f6dd)
|
||||
|
||||
Phantom types are marker traits that exist only to provide annotations to the compiler.
|
||||
As a usage of phantom types, let's look at the structure of a list.
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# Projection Type
|
||||
|
||||
[](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/type/advanced/projection.md&commit_hash=417bfcea08ed0e09f715f5d272842510fca8f6dd)
|
||||
|
||||
A projection type represents a type such as ``Self.AddO`` in the following code.
|
||||
|
||||
```erg
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# Quantified Dependent Type
|
||||
|
||||
[](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/type/advanced/quiantified_dependent.md&commit_hash=d74df7d22b021da0588ee1dad78582f13685c047)
|
||||
|
||||
Erg has quantified and dependent types. Then naturally, it is possible to create a type that combines the two. That is the quantified dependent type.
|
||||
|
||||
```erg
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# Shared Reference
|
||||
|
||||
[](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/type/advanced/shared.md&commit_hash=ae6d00168c17428bf967e44db3e6360e2471df8b)
|
||||
|
||||
Shared references are one of those language features that must be handled with care.
|
||||
In TypeScript, for example, the following code will pass type checking.
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# Special Type(Self, Super)
|
||||
|
||||
[](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/type/advanced/special.md&commit_hash=ae6d00168c17428bf967e44db3e6360e2471df8b)
|
||||
|
||||
`Self` represents itself types. It can be used simply as an alias, however note that its meaning changes in derived types (it refers to the derived own type).
|
||||
|
||||
```erg
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# Tips
|
||||
|
||||
[
|
||||
](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/tips.md&commit_hash=96132b20f6efb8fab884195f7f5144dc87e20be1)
|
||||
|
||||
## Want to change the language in which errors are displayed
|
||||
|
||||
Please download Erg for your language.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue