ava/general-syntax.md

1.3 KiB

General Syntax

Type Binding

Some name may be bound to some type by using the : (colon) syntax.

name: Type

Type bindings are used for all such occurrences. This includes:

Value Binding

Some name may be bound to some value by using the := syntax.

name := value
name: Type := value

Value bindings are used for all such occurrences. This includes:

Comments

Comments are lines where the first non-whitespace characters are --. This was selected for ease of typing paired with low visual noise.

-- this is a comment
-- this is another comment
let x := "foo" -- this will not compile, comments cannot be mixed with code

Ava does not support multi-line comments.

Code Documentation

Code documentation is written using comments that both directly-precede certain definitions and have 3 - characters:

--- This function does some foo as well as some bar.
--- @param x Documentation for the `x` parameter.
fn foo_bar: (x: String) => Int32
  • Code documentation respects Markdown.
  • TODO: Link syntax.
  • TODO: Supported definitions (example for each)
  • TODO: Parameter documentation