This paragraph concentrates on giving some kind of informal grip on the language, before putting the focus on more fundamental design issues.
From a lexical point of view, YAFL is close to Modula II [Wirth 88] or Oberon [Wirth 92]. Reserved words are in capital letters, and uppercase and lowercase letters are considered different in identifiers. Many constructs have similar structures: statements, operators, expressions, declarations, etc...
YAFL also supports Modula's separation of a module into a definition and an implementation part. Every module includes one or more classes. Unlike Eiffel where the module structure is the same as the class structure, YAFL's modular structure provides an additional layer of abstraction above the class structure. YAFL's approach is also different from C++'s, where the module structure is supported by de facto conventions (.c and .h files) but not by the language itself.
A module can refer to external modules's classes through import lists. No explicit export list is needed: every item present in a module's definition part is implicitely made visible for external modules. Such an item is said to be public.
YAFL also supports two type constructors, that can be used to build new data types: classes and arrays. YAFL supports basic data types with a Pascal-like value semantics (instead of the reference semantics attached to objects and arrays):
Classes are abstract data types, made of:
YAFL's arrays use Modula II's notation, but their semantics are slightly different. YAFL's arrays are dynamic: they must be allocated explicitely, and their size must be specified at runtime.
Some common array operations are predefined, and can be invoked like methods. They are called pseudo-methods because unlike genuine ones, they cannot be redefined: CREATE, CLONE, HIGH and SLICE.
See also: