update readme
This commit is contained in:
parent
2024677225
commit
79ee784a5b
1 changed files with 7 additions and 7 deletions
12
README.md
12
README.md
|
@ -10,7 +10,7 @@ func main { mega | with args ;
|
|||
{ str | " " concat } swap:map
|
||||
&print swap:foreach
|
||||
"" println
|
||||
println <{ "and with that, we're done" }
|
||||
println<"and with that, we're done">
|
||||
0
|
||||
}
|
||||
```
|
||||
|
@ -177,19 +177,19 @@ func main { mega | with args ;
|
|||
```
|
||||
- SPL actually isn't fully concatenative. It supports postfix arguments as well:
|
||||
```js
|
||||
println <{ "and with that, we're done" }
|
||||
println<"and with that, we're done">
|
||||
```
|
||||
This is actually not a special interpreter feature, more so is it a special
|
||||
lexer feature. This is 100% equivalent with the non-postfix version, where the
|
||||
string is right before the `println`.
|
||||
|
||||
The same can be done for object calls. Let's rewrite the previous code with
|
||||
postfix:
|
||||
prefix notation:
|
||||
```js
|
||||
Range:new <{ 0 5 }
|
||||
Range:new<0 5>
|
||||
:iter
|
||||
:map <{ { | 5 * } }
|
||||
:foreach <{ { | _str println } }
|
||||
:map<{ | 5 * }>
|
||||
:foreach<{ | _str println }>
|
||||
```
|
||||
|
||||
I lied. This is now no longer 100% equivalent. Let's look at what happens
|
||||
|
|
Loading…
Add table
Reference in a new issue