Table des matières

Types and Fonctions in Kmelia

Kmelia types can be predefined types or user-defined types. Predefined types can be primitive types or abstract data types.

A (currently) restricted form of Generic types, anchor type and subtyping is allowed in Kmelia.

In a Kmelia specification Data Types are used in the variable definition clauses (component, service…).

name : String;
tab: montablo;
point_test : Point; 
swallowed_cards : setOf CashCard;
other_cards : setOf CashCard;
available_notes : Integer;
intset:monset;
intset2:setOf Integer

Primitive Types

primitive types are :

library contents here

Structured Types

Structured types are :

Abstract Data Types

Only one default type here for the moment.

library contents here

User-defined Types

In a Component definition

With the TYPE clause

  TYPES
  CashCard:: struct {code:Integer; ident:Integer; limit:Integer};
  montablo:: array [1..10] of Integer;
  monset :: setOf Integer
  RVB :: enum {R,V,B};
In libraries of types and functions

see libraries