From 96e3c59673d838cf3b805f941a21a10467ea6afc Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Tue, 30 Aug 2022 05:57:17 +0000 Subject: [PATCH] Update 'Interface Definitions' --- Interface-Definitions.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Interface-Definitions.md diff --git a/Interface-Definitions.md b/Interface-Definitions.md new file mode 100644 index 0000000..7aac9dc --- /dev/null +++ b/Interface-Definitions.md @@ -0,0 +1,21 @@ +# Syntax +``` +face ro ReadWriter:Face + write + > data:{Byte ..} + < wrote:Int + < err:Error + read + > into:{Byte ..} + < read:Int + < err:Error +``` + +Interface sections contain a list of behaviors. Behaviors are a name followed by an indented block of inputs and outputs. It is essentially a more stripped down version of function syntax. + +# Semantics +Interfaces in ARF are like interfaces in Go, that is to say, their methods are +defined and any object that has at least those methods can fulfill that +interface. + +Interfaces are able to inherit other interfaces using type notation. If an interface inherits nothing, it must inherit `Face`, which is a blank interface. \ No newline at end of file