|Page 208 of 800||Search internet|
Objects are created by the construct and a destructured into components by .
Evaluation of creates an object with tag and value v. The tag must be a pair of naturals (i.e. natural numbers). We refer to the first natural r as a 'reference' and the the second as an 'index'. Destructuring works the other way in that
The tag is not allowed to have one of the values , , , , and since those tags are reserved for Booleans, integers, pairs, exceptions, and tagged maps, respectively.
Objects allow users to define new data types. Furthermore, objects allow to program new versions of the Logiweb abstract machine which provide built in support for other types than Booleans, integers, pairs, exceptions, and tagged maps. Among other, lgwam badly needs built in support for IEEE floating point numbers, and such support is likely to appear in some, future release of lgwam.
By convention, the reference r and index i of a tag should be selected as follows:
By convention, when one uses a tag where r is zero and i is a string, the string should be a non-reserved string. A string is reserved if all characters of the string are reserved. A character is reserved if it is a space character or a small letter in the range a to z of the ASCII alphabet. Thus, a string like 'math/kg' is non-reserved because it contains a slash and a string link 'Hello' is non-reserved because it contains a capital letter. Reserved strings are reserved for future extensions of the Logiweb standard. When I need a non-reserved string, I use a slash followed by my initials. Feel free to make your own convention.
|Page 208 of 800||Search logiweb.eu|