From ec44661babdd07751975925864a7fc12d046f270 Mon Sep 17 00:00:00 2001 From: gavr <30507409+gavr123456789@users.noreply.github.com> Date: Mon, 17 Mar 2025 17:22:35 +0200 Subject: [PATCH] ~~codeblock~~ lambda --- niva.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/niva.md b/niva.md index b7a00925..1dec18ec 100644 --- a/niva.md +++ b/niva.md @@ -208,7 +208,7 @@ c <- 3 // reset c c echo // 3 2 1 ] ``` -`whileTrue:` is a message for codeblock of the type: +`whileTrue:` is a message for lambda object of the type: `[ -> Boolean] whileTrue::[ -> Unit]` #### Matching @@ -322,15 +322,21 @@ Person foo = [ #### Compile time reflection You can get string representation of any argument from a call site. ```Scala -Foo bar::Int baz::String = [ +Int bar::Int baz::String = [ // getting string representation from call side a = Compiler getName: 0 b = Compiler getName: 1 c = Compiler getName: 2 - a echo - b echo - c echo + a echo // 1 + 1 + b echo // variable + c echo // "str" ] + +variable = 42 +// call side +1 + 1 + bar: variable + baz: "str" ``` Links: