Files
boring-lang/notes.txt

59 lines
873 B
Plaintext
Raw Normal View History

2021-05-05 19:32:55 -06:00
# On types
Type Usage != Type Definition
type List[T] struct {
}
fn add[T: addable](a: T, b: T): T {
return a + b;
}
type usages:
List[Int64]
fn(int, int): List[Int64]
@dataclass
class TypeUsage:
result: Identifier # Result of useage - either is the type, or is the return value if it's a function
type_args: List[Type] # Generics
arguments: Optional[List[Type]] # Specified if it is a function, this is how you tell if it's a function
2021-05-29 10:50:15 -06:00
2021-05-30 10:02:58 -06:00
if / match return never if all blocks return never;
blocks propagate never except at the function level;
2021-05-29 10:50:15 -06:00
TODO:
* ~Float Literals~
2021-05-29 12:16:03 -06:00
* ~Block expression~
2021-06-01 23:05:17 -06:00
* ~Return keyword~
* ~Normal assignment~
2021-06-12 12:47:10 -06:00
* ~Structs~
2021-06-11 20:59:51 -06:00
* ~Define~
2021-06-12 10:59:58 -06:00
* ~Literal~
2021-06-12 12:26:53 -06:00
* ~Getter~
2021-06-12 12:47:10 -06:00
* ~Setter~
2021-06-13 10:38:13 -06:00
* ~Type Aliases~
2021-05-29 10:50:15 -06:00
* Methods
2021-06-13 10:38:13 -06:00
* ~Declaration~
* Use
2021-06-11 20:59:51 -06:00
* Traits
2021-06-12 12:26:53 -06:00
* Generics
* Enums
2021-05-30 10:02:58 -06:00
* Arrays
* Strings
2021-06-11 20:59:51 -06:00
* Lambdas
2021-05-29 10:50:15 -06:00
* Async
2021-06-11 20:59:51 -06:00
* Imports
2021-06-13 10:38:13 -06:00
* Visibility
* Const / Mut