-val job_evaluate : job -> variables -> bool -> bool * job
-(** [job_evaluate job variables onload] evaluates [job]'s condition in
- the context of the [variables], and return [true] iff it should be
- run now.
+val eval_whenexpr : variables -> variables option -> bool -> whenexpr -> variable
+val eval_whenexpr_as_bool : variables -> variables option -> bool -> whenexpr -> bool
+(** [eval_whenexpr variables prev_variables onload expr] is the
+ evaluation function for when expressions. It full evaluates
+ [expr], returning its typed value. It can also throw exceptions
+ (at least [Invalid_argument] and [Failure]).
+
+ [eval_whenexpr_as_bool] is the same but it forces the returned
+ value to be a boolean.
+
+ The other parameters represent the current and past state:
+
+ [variables] is the current set of variables and their values.