mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-04-26 15:13:56 +00:00
add install instructions
This commit is contained in:
parent
6cd883c3c2
commit
b510eb9a10
19
niva.md
19
niva.md
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: niva
|
name: niva
|
||||||
filename: learnniva.niva
|
filename: main.niva
|
||||||
contributors:
|
contributors:
|
||||||
- ["gavr", "https://github.com/gavr123456789"]
|
- ["gavr", "https://github.com/gavr123456789"]
|
||||||
---
|
---
|
||||||
@ -22,6 +22,14 @@ Links:
|
|||||||
- [LSP](https://github.com/gavr123456789/vaLSe)
|
- [LSP](https://github.com/gavr123456789/vaLSe)
|
||||||
- [VSC plugin](https://github.com/gavr123456789/niva-vscode-bundle)
|
- [VSC plugin](https://github.com/gavr123456789/niva-vscode-bundle)
|
||||||
|
|
||||||
|
Install:
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/gavr123456789/Niva.git
|
||||||
|
cd Niva
|
||||||
|
./gradlew buildJvmNiva
|
||||||
|
# LSP here https://github.com/gavr123456789/niva-vscode-bundle
|
||||||
|
```
|
||||||
|
|
||||||
## The Basics
|
## The Basics
|
||||||
|
|
||||||
#### Variable
|
#### Variable
|
||||||
@ -175,8 +183,9 @@ p3 = Point y: 20 // x: 0 y: 20
|
|||||||
```
|
```
|
||||||
|
|
||||||
#### Cycles
|
#### Cycles
|
||||||
There is no special syntax for cycles, its just keyword messages that takes codeblocs as parameters.
|
There is no special syntax for cycles.
|
||||||
(its zero cost thanks for inlining)
|
It's just keyword messages that take codeblocks as parameters.
|
||||||
|
(it's zero cost thanks for inlining)
|
||||||
```Scala
|
```Scala
|
||||||
{1 2 3} forEach: [ it echo ]
|
{1 2 3} forEach: [ it echo ]
|
||||||
1..10 forEach: [ it echo ]
|
1..10 forEach: [ it echo ]
|
||||||
@ -270,7 +279,7 @@ e = x unpackOrValue: -1
|
|||||||
x = file read orPANIC
|
x = file read orPANIC
|
||||||
x = file read orValue: "no file"
|
x = file read orValue: "no file"
|
||||||
```
|
```
|
||||||
Errors works like effects, look for more in [Error handling](https://gavr123456789.github.io/niva-site/error-handling.html)
|
Errors work like effects, look for more in [Error handling](https://gavr123456789.github.io/niva-site/error-handling.html)
|
||||||
|
|
||||||
## Misc
|
## Misc
|
||||||
|
|
||||||
@ -288,7 +297,7 @@ Person foo = [
|
|||||||
```
|
```
|
||||||
|
|
||||||
#### Compile time reflection
|
#### Compile time reflection
|
||||||
You can get string representation of any argument from call site.
|
You can get string representation of any argument from a call site.
|
||||||
```Scala
|
```Scala
|
||||||
Foo bar::Int baz::String = [
|
Foo bar::Int baz::String = [
|
||||||
// getting string representation from call side
|
// getting string representation from call side
|
||||||
|
Loading…
Reference in New Issue
Block a user