site/docs improvements

This commit is contained in:
sergeych committed 2025-11-28 11:25:47 +01:00
1 parent 26ddb94f5d
commit e584c7aa63
8 files changed
+33 -11

No files matched your search

+6 -2
View File
@@ -1,6 +1,10 @@
# OO implementation in Lyng
# Object-oriented programming
## Declaration
[//]: # (topMenu)
Lyng supports first class OOP constructs, based on classes with multiple inheritance.
## Class Declaration
The class clause looks like
+2
View File
@@ -1,5 +1,7 @@
# Declaring arguments in Lyng
[//]: # (topMenu)
It is a common thing that occurs in many places in Lyng, function declarations,
lambdas and class declarations.
+3 -1
View File
@@ -1,4 +1,6 @@
# Parallelism in Lyng
# Multithreading/parallel execution
[//]: # (topMenu)
Lyng is built to me multithreaded where possible (e.g. all targets byt JS and wasmJS as for now)
and cooperatively parallel (coroutine based) everywhere.
+2
View File
@@ -1,6 +1,8 @@
# Map literals — refined proposal
[//]: # (excludeFromIndex)
Implement JavaScript-like literals for maps. The syntax and semantics align with named arguments in function calls, but map literals are expressions that construct `Map` values.
Keys can be either:
+4 -1
View File
@@ -1,4 +1,7 @@
# Named arguments proposal
# Named arguments in calls
[//]: # (excludeFromIndex)
Extend function/method calls to allow setting arguments by name using colon syntax at call sites. This is especially convenient with many parameters and default values.
+2
View File
@@ -1,5 +1,7 @@
# The `when` statement (expression)
[//]: # (topMenu)
Lyng provides a concise multi-branch selection with `when`, heavily inspired by Kotlin. In Lyng, `when` is an expression: it evaluates to a value. If the selected branch contains no value (e.g., it ends with `void` or calls a void function like `println`), the whole `when` expression evaluates to `void`.
Currently, Lyng implements the "subject" form: `when(value) { ... }`. The subject-less form `when { condition -> ... }` is not implemented yet.