diff --git a/Phrases.md b/Phrases.md new file mode 100644 index 0000000..078b859 --- /dev/null +++ b/Phrases.md @@ -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. \ No newline at end of file