print.Print {aoos} | R Documentation |
S3 helper classes
Description
There is no formal class definition for S3. Simply add 'Infix' or 'Print' to the class attribute and it inherits the methods. It is the same as Binary-class
or Show-class
just for S3. This is inteded to be used with retList
.
Usage
## S3 method for class 'Print'
print(x, ...)
## S3 method for class 'Infix'
e1 + e2
## S3 method for class 'Infix'
e1 - e2
## S3 method for class 'Infix'
e1 / e2
## S3 method for class 'Infix'
e1 %% e2
## S3 method for class 'Infix'
e1 ^ e2
## S3 method for class 'Infix'
e1 < e2
## S3 method for class 'Infix'
e1 > e2
## S3 method for class 'Infix'
e1 == e2
## S3 method for class 'Infix'
e1 >= e2
## S3 method for class 'Infix'
e1 <= e2
## S3 method for class 'Infix'
e1 & e2
## S3 method for class 'Infix'
!x
## S3 method for class 'Infix'
as.environment(x)
Arguments
x |
an object |
... |
arguments passed to the local print method. |
e1 |
lhs operand |
e2 |
rhs operand |
Details
The lhs is coerced with as.environment
and in that environment the binary operators must be found and named as .<binaryOperator>
(see the example for retList
). This is implemented for the following operators: +, -, *, /, %%, ^, <, >, ==, >=, <=, &
. Also part of the operators you can implement with Infix is !
, although it is unary.
See Also
[Package aoos version 0.5.0 Index]