@@ -6,10 +6,12 @@ struct LoggedFun{F}
66 args:: Any
77 error_nonfinite:: Bool
88end
9- LoggedFunctionException (lf:: LoggedFun , args, msg) = LoggedFunctionException (
10- " Function $(lf. f) ($(join (lf. args, " , " )) ) " * msg * " with input" *
11- join (" \n " .* string .(lf. args .=> args)) # one line for each "var => val" for readability
12- )
9+ function LoggedFunctionException (lf:: LoggedFun , args, msg)
10+ LoggedFunctionException (
11+ " Function $(lf. f) ($(join (lf. args, " , " )) ) " * msg * " with input" *
12+ join (" \n " .* string .(lf. args .=> args)) # one line for each "var => val" for readability
13+ )
14+ end
1315Base. showerror (io:: IO , err:: LoggedFunctionException ) = print (io, err. msg)
1416Base. nameof (lf:: LoggedFun ) = nameof (lf. f)
1517SymbolicUtils. promote_symtype (:: LoggedFun , Ts... ) = Real
@@ -30,7 +32,9 @@ function logged_fun(f, args...; error_nonfinite = true) # remember to update err
3032 term (LoggedFun (f, args, error_nonfinite), args... , type = Real)
3133end
3234
33- debug_sub (eq:: Equation , funcs; kw... ) = debug_sub (eq. lhs, funcs; kw... ) ~ debug_sub (eq. rhs, funcs; kw... )
35+ function debug_sub (eq:: Equation , funcs; kw... )
36+ debug_sub (eq. lhs, funcs; kw... ) ~ debug_sub (eq. rhs, funcs; kw... )
37+ end
3438function debug_sub (ex, funcs; kw... )
3539 iscall (ex) || return ex
3640 f = operation (ex)
0 commit comments