Skip to content
This repository has been archived by the owner on Sep 23, 2023. It is now read-only.

Commit

Permalink
README updated
Browse files Browse the repository at this point in the history
  • Loading branch information
nyzd committed Sep 11, 2023
1 parent 10bb645 commit 7bcb14a
Showing 1 changed file with 15 additions and 32 deletions.
47 changes: 15 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ Functions can defined with `fn` keyword, for example
```
import std
fn callme do
fn callme -> {
str Helloworld printstr
end
}
callme
call callme
```

output:
Expand All @@ -28,13 +28,13 @@ HelloWorld
also you can specify a arguments of a function after name of function for example:

```
fn callme x y z do
fn callme x y z -> {
x put
y put
z put
end
}
1 2 3 callme
1 2 3 call callme
```

output:
Expand All @@ -45,19 +45,6 @@ output:
1
```

# Macros
```
macro x
1 2 add
end
```
if you call macro compiler will run body of macro
for example:
```
x put
```
will return: `3`

# Let
`let` is like global variables, unlike macros let cant hold expression only holds value `float64`

Expand Down Expand Up @@ -115,15 +102,11 @@ will return `1`
`then` runs function if the top of stack is true
example:
```
import std
macro x str GOOD printstr end
1 1 eq then x
```
this will return
```
GOOD
1 1 eq then {
1 put
}
```

# Times
`times` is a keyword like `for` loops

Expand All @@ -132,9 +115,9 @@ times will pop the top of stack and do body of times x times
example:

```
3 times
3 times {
1 print
done
}
```

will return:
Expand All @@ -151,7 +134,7 @@ example:
```
import lib.jsl
test
call test
```

will return:
Expand All @@ -163,9 +146,9 @@ HelloWorld
lib.jsl:

```
macro test
fn test -> {
str HelloWorld putstr
end
}
```

OR import standard library
Expand Down

0 comments on commit 7bcb14a

Please sign in to comment.