Bundt Scripting Reference · Bundt Scripting Language version 1.0.1.0

var statement

Declares one or more variable, optionally initializing their values.

Syntax

var %[VariableName] : (seq | dic)* TypeName [SubTypeName], ...
var %[VariableName] = Expression, ...

Element Type Optionality Notes
VariableName Identifier Mandatory. Specifies the name of the variable to declare.
seq Optional. Specifies that the variable is a sequence.
dic Optional. Specifies that the variable is a dictionary.
TypeName Identifier Mandatory. Specifies the type of the variable. This includes the native ConML simple data types plus the main classes in the ConML metamodel.
SubTypeName Identifier Optional. Specifies the subtype of the variable, in case the type is Object (specifies the class) or EnumeratedItem (specifies the enumerated type).
Expression Expression Mandatory. Specifies the initial value to assign to the variable.

Returns

A dictionary of the declared variables plus their values.

Examples

Intent Code
Declare a variable of a simple type var %a: Number;
Declare a variable of a metamodel type var %c: Class;
Declare a variable of a metamodel type with a given subtype var %p: Object Person;
Declare a variable with implicit typing var %x = "Hello, world!";

See Also


Contents distributed under a Creative Commons Attribution 4.0 International License · About · Terms of Use · Contact Us · last updated on 08 October 2020