Update 'Phrases'

Sasha Koshka 2022-08-30 05:59:39 +00:00
parent cc871db833
commit 69be3e7ff3

29
Phrases.md Normal file

@ -0,0 +1,29 @@
ARF does not make a syntactical distinction between functions and operators. It
instead has a concept called a phrase, which is similar to an [s-expression](https://en.wikipedia.org/wiki/S-expression) in lisp. A phrase is
just a list of [arguments](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, or the presence of a [return direction](Return-Direction) arrow.