Eval in context

Many functions have a variable number of parameters for special cases.

For instance,

valid()
valid(item*)
valid(item*, boolean)
valid(item*, boolean, boolean)


and

string  serialize(item*)
string  serialize(item*, $params)

(and others).

And yet we have:

item()*  eval(string)
  Evaluates the string as an expression in the current context.

item()*  eval-in-context(string, node()*)
  Evaluates the string as an expression in the given context.

Is there a reason for this?

Steven

Received on Wednesday, 5 February 2020 11:43:48 UTC