1.1.1-SNPASHOT some serious bugs in initilazation fixed. They were revealed by delegation real world usage

This commit is contained in:
sergeych committed 2026-01-05 21:13:42 +01:00
1 parent 20f777f9f6
commit f792c73b8f
17 files changed
+283 -48

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
[//]: # (excludeFromIndex)
# String
# This document is for developer notes only
--------------------------
## Interpolation proposal
"""no $iterpolation"""
val inpterpolation1 = "foo"
"${interpolation1}"
>>> "foo"
"$interpolation2"
"no $$ interpolatino"
## Regexp vs div / ?
```EBNF
regex_literal = "/", { regchar }, "/", [ flag ]
foag = "i" | "n"....
regchar = x`x`
```
+45
View File
@@ -0,0 +1,45 @@
# Modules inclusion
[//]: # (excludeFromIndex)
Module is, at the low level, a statement that modifies a given context by adding
here local and exported symbols, performing some tasks and even returning some value
we don't need for now.
The compiled module is therefore a statement. When we execute it on some context,
it wills it with all it symbols, private too.
If we call it on another context, it will do it once more, no caching. This is unnecessary
if not dangerous repetition.
## What is inclusion?
The _goal_ of the inclusion is to make _exported symbols_ available in a given context,
without re-executing included module initialization code. So, when we hit the `import foo`,
we should check that foo module was executed, execute it if not on special context we store in the library, then copy all public symbols from fooContext into current one.
## Class pseudo-module
Mostly same we can do with a class
## Module initialization
We can just put the code into the module code:
module lying.samples.module
// or package?
val startuptTime = Instant.now()
// private: not available from outside
private fun moduleInitialization() {
// long code
}
// this will be called only once
moduleInitialization()
## class initialization
already done using `ObjInstance` class and instance-bound context with local
context stored in ObjInstance and class constructor statement in ObjClass.
+15
View File
@@ -0,0 +1,15 @@
[//]: # (excludeFromIndex)
Provide:
fun outer(a1)
// a1 is caller.a1:arg
val a1_local = a1 + 1
// we return lambda:
{ it ->
// a1_local
a1_lcoal + it
}
}