diff --git a/Return-Direction.md b/Return-Direction.md new file mode 100644 index 0000000..42baac3 --- /dev/null +++ b/Return-Direction.md @@ -0,0 +1,19 @@ +The way ARF handles return values from functions is different from other +languages, and is greatly enhanced by its ability to define variables in-place. It +is done by placing an arrow called a return direction after the [phrase](Phrases): + +`file.write bytes -> bytesWritten:Size err` + +The advantage of this is a new variable can be defined without having to +re-define and therefore shadow `err`, sidestepping a major problem that Go has. + +If a phrase is enclosed in brackets, the return direction arrow lies outside of +them: + +`[file.write bytes] -> bytesWritten:Size err` + +Return direction cannot be used with phrases that are already being used as +arguments. Its one of those things that, very elegantly, makes no sense +conceptually or syntactically. + +Return directions are terminated by a line break. \ No newline at end of file