Skip to content
Dmitry Zavalishin edited this page Sep 19, 2019 · 2 revisions

Table of Contents

Predefined (object) method ordinals

Here are methods with fixed ordinals. These are mostly methods of 'object' - the very

root class in language. Methods 8-14 are not defined for object in any usable way (will throw on call to them) and exist only to be redefined in other special classes. (That's historical and has no reason now.)

0 - (not implemented) default parameter-less constructor

This method is called automatically on object creation.

1 - (not implemented) finalize

Is called by garbage collector on object disposal

2 - getClass

Returns class of object.

NB – this is a way to overcome reference-given interface and obtain default interface for the object. This is a problem for interface-based access control scheme implementation.

3 - (not implemented) clone

Returns shallow copy of object.

4 - equals

Returns true if passed object is equal to this.

NB – value comparison is assumed.

5 - toString

Returns object value converted to string.

6 - (not implemented) toXML(Stringbuf out, String tagName, var passed_objects[])

Method will be generated by compiler, if not defined explicitly. Will NEVER be inherited! tagName is a name of tag we will output. Calls toXML for all fields. Atomic fields to be represented as parameters? passed_objects are for loop check. If loop - throw.

TODO – use class name as tag?

7 - (not implemented) fromXML(String data)

Method will be generated by compiler, if not defined explicitly. Will NEVER be inherited! Calls fromXML for all fields with corresponding to tags or parameters names.

8 - (not implemented) 'operator ()' method, default activity

This is a ‘default activity’ method which is often called implicitly by compiler for objects of some predefined system classes. Examples:

  • For closure – ??? (not implemented) activate it.
  • For array object – return iterator (not implemented).
  • For iterator – ??? (not implemented) return pointer to object.
  • For class class object – new class( name, data_area_size, interface )
  • For boot class – class load_class( string file_name );
  • For thread – start execution

9 – Secondary activity

  • For boot class – code load_method( string file_name ); - obsolete, throws
  • For array object – ??? (not implemented) return subarray
  • For string – ??? (not implemented) return substring
  • For class object ??? (not implemented) return interface by number.

10 – Third activity

  • For array object – get_element( index )

11 – Fourth activity

  • For array object – set_element( index ) – extends array

12 - (not implemented) ??? operator ++

13 - (not implemented) ??? operator --

14 - (not implemented) ??? operator =

15 – hashCode

Returns integer, used in hash tables.

Notes

As project evolves we should deprecate using predefined ordinals.

Clone this wiki locally