Description Usage Arguments Value Author(s) See Also Examples
This function is a constructor for specifying different permissible combinations of argument types in a call to a function. Each combination of types identifies a signature and in a call, the types of the arguments are compared with these types. If all are compatible with the specification, then the call is valid. Otherwise, we check other permissible combinations.
Note that if an instance of
SimultaneousTypeSpecification-class
is provided to the checkArgs
function, the TypedSignature-class
elements are searched sequentially until a matching one is found.
That matching signature is returned. Therefore, the order the
signatures are specified within the
SimultaneousTypeSpecification-class
object is
important. This could change if we wanted. At present, it is up to the author to specify
what they want to have happen. We could use the S4 signature
matching technique when this is finalized and implemented in C code.
1 | SimultaneousTypeSpecification(..., returnType, obj = new("SimultaneousTypeSpecification", list(...)))
|
... |
named |
returnType |
if supplied this should be an object of class |
obj |
the instance of |
The return value is obj
.
By default, this has class SimultaneousTypeSpecification-class
.
It should be an object of class TypeSpecification-class
.
Duncan Temple Lang <duncan@wald.ucdavis.edu>
IndependentTypeSpecification
typeInfo
1 2 3 4 5 6 7 8 9 10 | foo =
function(x, y)
{
x + y
}
typeInfo(foo) =
SimultaneousTypeSpecification(
TypedSignature(x = "integer", y = "integer"),
TypedSignature(x = "numeric", y = "logical"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.