new

new A of b from c -- make a hash table of class AA and parent b initialized from c.
new A of b -- make a hash table of class AA and parent b.
new A from c -- make a hash table or list of class AA initialized from c.
new A -- makes a hash table or list n of class AA.


new A of b from c -- make a hash table n of class AA and parent b initialized from c.

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.


new A of b -- make a hash table of class A and parent b.

Same as above, except c is missing. Use

               new AA of B := (A,b) -> ... 
to install the initialization routine.
new A from c -- make a hash table or list n of class A initialized from c.

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.


new A -- make a hash table or list n of class A.

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.