update readme

This commit is contained in:
Daniella / Tove 2024-09-08 12:51:17 +02:00
parent 2024677225
commit 79ee784a5b

View file

@ -10,7 +10,7 @@ func main { mega | with args ;
{ str | " " concat } swap:map { str | " " concat } swap:map
&print swap:foreach &print swap:foreach
"" println "" println
println <{ "and with that, we're done" } println<"and with that, we're done">
0 0
} }
``` ```
@ -177,19 +177,19 @@ func main { mega | with args ;
``` ```
- SPL actually isn't fully concatenative. It supports postfix arguments as well: - SPL actually isn't fully concatenative. It supports postfix arguments as well:
```js ```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 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 lexer feature. This is 100% equivalent with the non-postfix version, where the
string is right before the `println`. string is right before the `println`.
The same can be done for object calls. Let's rewrite the previous code with The same can be done for object calls. Let's rewrite the previous code with
postfix: prefix notation:
```js ```js
Range:new <{ 0 5 } Range:new<0 5>
:iter :iter
:map <{ { | 5 * } } :map<{ | 5 * }>
:foreach <{ { | _str println } } :foreach<{ | _str println }>
``` ```
I lied. This is now no longer 100% equivalent. Let's look at what happens I lied. This is now no longer 100% equivalent. Let's look at what happens