fble-0.5 (2025-07-13,fble-0.4-212-ga8f8ad0f)
This document records a particular style of fble programming. It's not necessarily a good one, but it can at least be used as an explicit and canonical one.
Type names are capitalized. For example: Foo@
, FooBar@
.
Top level declarations are capitalized. For example: And
, DrawBox
.
Argument names are lower case. For example: (Foo@ x) { ... }
Struct and union fields should be lower case.
Module names are capitalized. For example: /Bool%
, /GameOfLife%
.
Parenthesized or braced expressions can be split across multiple lines. If so, indent by 2 spaces. Put the close brace on its own line and the end aligned with the entity. Closed parenthesis can go on the last line instead of its own line; that's usually preferred unless the clarity of having it on its own line justifies the extra line.
For example:
... [ ..., ..., ...] ... ( ..., ..., ...) ... { ...; ...; }
For long declarations types, break after the type when defining a variable. For example:
<@ T@>(Symbol@, T@, Array@<T@>) { Array@<T@>; } Set = <@ T@>(Symbol@ s, T@ x, Array@<T@> a) { ... }
It's fine to group multiple args together on the same line if they fit when breaking up a larger thing across multiple lines. For example:
... ( ..., ..., ... ..., ..., ... )
Put space between braces but not parenthesis. For example:
[a, b, c] Foo(a, b, c) Foo { a; b; c; }
Module imports should come first in a file, grouped by import module, sorted by import module path. Within a group, import types first followed by values. Sort imports by name.
Use _
as the name of unused variables.