Update 'Phrases'

Sasha Koshka 2022-08-24 05:45:32 +00:00
parent 2e8c99764f
commit b6b985b8d5
1 changed files with 29 additions and 0 deletions

29
Phrases.md Normal file

@ -0,0 +1,29 @@
ARF does not make a syntactical distinction between functions and operators. It
instead has a syntactical concept similar to s-expressions in lisp. A phrase is
just a list of arguments, where the first argument is the function, method, or
operator to execute, and the rest are, well, arguments to it.
Phrases sometimes need to be delimited by square brackets:
`[f arg1 arg2 arg3]`
But, if the phrase does not contain any line breaks *directly* in it, and it is
not being used as an argument, it can be written without the brackets:
`f arg1 arg2 arg3`
A phrase need not have brackets if the line break(s) inside of it are contained
within brackets:
```
f [g
arg1
arg2] arg3
```
However, a phrase *must* have brackets if it is being used as an argument in any
context:
`f [g arg1 arg2] arg3`
If the phrase has no brackets, it is terminated by the end of its line.