invoke a function, type-function or array-function


myMethod(1, x^2, "hello\n", someThing)


IntList := List<int>; //List is a type function, IntList is a Type


print myArray[4]; //4 is ordered and denumerable, myArray implements RandomlyAccessible


The < > syntactic variety requires the returned value to be a type (it must implement Type), or a function (it must implement Function) that when invoked results in such a type or function. Note that this definition is deliberately recursive. The [ ] syntactic variety requires that each given "indexer" is some element of an ordered set, such as the natural numbers or enum values, and that the invokee is randomly accessible (implements RandomlyAccessible). Lastly, the angle bracket and square bracket syntax are optional; the behavior is identical to being invoked using parentheses. However, alternate syntax is encouraged whenever such requirements are met and helps to both document and enforce the invariants assumed by the author.

copyright © Brent Lewis 2017