One may use this to model the mathematical notion that x is an element of A and a subset of b. Here A and b are Objects, and c is any expression. Let b be an instance of B, c be an instance of C, and let AA be any ancestor of A. Then use
new AA of B from C := (A,b,c) -> ...to install the corresponding optional creation routine -- the value it returns will be converted so its class is A and its parent is b; this will involve copying unless the returned value is mutable and objects of class A are mutable.
If no installation routine has been installed, then c should be a hash table or a list, and it will be converted directly.
Same as above, except c is missing. Use
new AA of B := (A,b) -> ...to install the initialization routine.
The same as above except b is missing. Use
new AA from C := (A,c) -> ...to install the corresponding initialization routine.
Since no parent b has been provided, the value returned by the initialization routine will not have its parent reset. If there is no initialization routine the parent will be set to Nothing.
Same as above, except b and c are missing. Use new AA := A -> ... to install the initialization routine.
Since no parent b has been provided, the value returned by the initialization routine will not have its parent reset. If there is no initialization routine the parent will be set to Nothing.
The symbols NewMethod, NewOfMethod, NewFromMethod, and NewOfFromMethod are used for installation of the initialization routines.
See also classes.
Go to main index.
Go to concepts index.