Advanced Computing Environment
Hosted by SourceForge
brix-os project page

Previous: Types ----- Up: Contents ----- Next: Conditionals


show notes
Features that need to be added to the page or ideas that haven't been thought out.
  • the toString() property creates a string with the type name, parameters, slot names and slot values "Foo{slot1=100, slot2=Bar{...}}". types may override this property to change how the object is rendered (Number only displays the value). this property is used by ECHO and the REPL to display objects. the optional precision parameter is used primarily by the Number type and types that contain numbers. the ECHOF macro uses a format string that supports precision
    	%n = number, %.2n precision 2
    	%s = string
    	%c = character
    	%o = object
    	%r = reference address
    	%p = point, supports precision
  • runtime prototype objects (`dynamic Object)
    • An object that contains a hidden slot which contains a double-link list of slot names and associated data. Slots can be inserted and removed at runtime and the compiler traps all slot accesses and generates runtime lookup code. Types can inherit the `dynamic Object type and add permanent slots that don't use runtime lookups, but inheritance of such types is not allowed since it could break code that worked with the parent.

All types indirectly inherit the Object type and it can be used to accept any object or an object that inherits from multiple interfaces.

	a:Object = "string"
	a:Object of (relational_interface, addition_interface) = 1


Object of types
  • of -- required syntax when types is given
  • types -- list of interface constraints






Previous: Types ----- Up: Contents ----- Next: Conditionals