From ftm
Jump to: navigation, search
(Values and Lists)
(Values and Lists)
Line 10: Line 10:
 
The values of FTM expressions can be int, float, symbol or references to FTM object.
 
The values of FTM expressions can be int, float, symbol or references to FTM object.
 
They values can be represended by the following terms:
 
They values can be represended by the following terms:
* a ''simple'' value (int, float, symbol) such as '1', '2.3' and 'three'
+
* a '''''simple''''' value (int, float, symbol) such as '1', '2.3' and 'three'
* a ''named'' value such as $myobj
+
* a '''''named''''' value such as $myobj
* an ''element'' or ''propery'' of an object such as $myobj[7]
+
* an '''''element''''' or '''''propery''''' of an object such as $myobj[7]
* a numberd ''argument'' such as $1
+
* a numberd '''''argument''''' such as $1
  
Examples of '''simple''' values are
+
Examples of '''''simple''''' values are
 
* 1 ... an int
 
* 1 ... an int
 
* -2 ... an int
 
* -2 ... an int
Line 26: Line 26:
 
* -thirteen ... a symbol
 
* -thirteen ... a symbol
  
'''Named''' values are defined by FTM definitions using ''ftm.object''.
+
'''''Named''''' values are defined by FTM definitions using ''ftm.object''.
 
The names, always representing a single value, are used in expressions with a leading dollar – '$' – making for example:
 
The names, always representing a single value, are used in expressions with a leading dollar – '$' – making for example:
 
* $x
 
* $x
 
* $myobject
 
* $myobject
  
An '''element'''/'''propery''' of an object can be accessed with FTM expressions using brackets – '[' and ']'. Offen
+
An '''''element'''''/'''''propery''''' of an object can be accessed with FTM expressions using brackets – '[' and ']'. Offen
  
 
== Parenthesis ==
 
== Parenthesis ==

Revision as of 13:25, 6 June 2007

FTM expressions are used in the following contexts

  • the FTM message box (ftm.mess)
  • the FTM definition (ftm.object)
  • the expr class/object

The syntax is basically always the same appart from minor context dependent details.

Values and Lists

The values of FTM expressions can be int, float, symbol or references to FTM object. They values can be represended by the following terms:

  • a simple value (int, float, symbol) such as '1', '2.3' and 'three'
  • a named value such as $myobj
  • an element or propery of an object such as $myobj[7]
  • a numberd argument such as $1

Examples of simple values are

  • 1 ... an int
  • -2 ... an int
  • 2.3 ... a float
  • -4. ... a loat
  • 5.67e-4 ... a float
  • .89 ... a float
  • ten ... a symbol
  • 11-12 ... a symbol (because no space!)
  • -thirteen ... a symbol

Named values are defined by FTM definitions using ftm.object. The names, always representing a single value, are used in expressions with a leading dollar – '$' – making for example:

  • $x
  • $myobject

An element/propery of an object can be accessed with FTM expressions using brackets – '[' and ']'. Offen

Parenthesis

Parenthesis in FTM expressions – '(' and ')' – always will (try to) evaluate the contained elements to a single value.

Inside parenthesis you'd have either one

  • a value (in which case the parenthesis are useless)
  • a simple infix expression
  • a simple prefix expression