- new_seq.push_back(expair(Order(_ex1()), numeric(min(x.ldegree(s), order))));
- return series(s, point, new_seq);
+ GINAC_ASSERT(is_ex_exactly_of_type(r.lhs(),symbol));
+ const symbol *s = static_cast<symbol *>(r.lhs().bp);
+ new_seq.push_back(expair(Order(_ex1()), numeric(min(x.ldegree(*s), order))));
+ return pseries(r, new_seq);
+}
+
+// Differentiation is handled in function::derivative because of its special requirements
+
+REGISTER_FUNCTION(Order, eval_func(Order_eval).
+ series_func(Order_series));
+
+//////////
+// Inert partial differentiation operator
+//////////
+
+static ex Derivative_eval(const ex & f, const ex & l)
+{
+ if (!is_ex_exactly_of_type(f, function)) {
+ throw(std::invalid_argument("Derivative(): 1st argument must be a function"));
+ }
+ if (!is_ex_exactly_of_type(l, lst)) {
+ throw(std::invalid_argument("Derivative(): 2nd argument must be a list"));
+ }
+ return Derivative(f, l).hold();