Dom::Expression -- the domain
of all MuPAD objects of basic type
IntroductionDom::Expression comprises all objects only consisting
of operands of built-in types.
Creating
ElementsDom::Expression(x)
Parametersx |
- | An object of basic type consisting only of operands of
built-in types, or any other object convertible to such using expr. |
Cat::BaseCategory
Related
Domains
DetailsDom::Expression is a faēcade domain: it has no domain
elements, but uses system representation.Dom::ExpressionField,
Dom::Expression does not belong to any arithmetical
category, and its elements need not be arithmetical expressions.Dom::Expression mainly serves as a super-domain to
Dom::ArithmeticalExpression;
it rarely makes sense to use it directly.an identifier used for creating random elements
convert(any x)expr is used to
convert x into an object of basic type. This method does
not create elements of Dom::Expression, since
Dom::Expression has system representation.convert_to(expression x, any T)FAIL unless T is
Dom::Expression; in the latter case, x is
returned.expr(expression x)testtype(any x,
Dom::Expression)TRUE if x can be
converted to an expression, and FAIL otherwise. The second
argument must equal Dom::Expression; this is not
checked.testtype; since
Dom::Expression has no domain elements, the overloading
can only be caused by the second argument.float(expression x)float.subs(expression x, substitution s...)subs of the standard library; see there
for details about the calling syntax.subsex(expression x, substitution s...)subsex of the standard library; see
there for details about the calling syntax.random()
Example
1Almost every MuPAD object can be converted to an expression. Objects of basic type are expressions.
>> Dom::Expression([3, array(1..2), rectform(exp(I))])
-- +- -+ --
| 3, | ?[1], ?[2] |, cos(1) + I sin(1) |
-- +- -+ --
The convert method flattens its argument:
hence expression sequences are not allowed.
>> Dom::Expression((3, x))
Error: expecting one argument [Dom::Expression::convert]
Super-DomainAx::systemRep
, Ax::efficientOperation("_divide"),
Ax::efficientOperation("_mult"),
Ax::efficientOperation("_invert")