I like the addition of safe_op to STACK because it's nice to know that you're always dealing with a string. After some awkward troubleshooting, I've just noticed that get_ops calls op instead of safe_op.
I imagine that just swapping op for safe_op would break all sorts of unexpected things, so might I suggest that we add get_safe_ops to assessment.mac? My suggested code is:
get_safe_ops(ex):= setify(flatten(get_safe_ops_helper(ex)))$get_safe_ops_helper(ex):=if mapatom(ex) then [] else append([safe_op(ex)],maplist(get_safe_ops_helper,args(ex)))$
I like the addition of
safe_op
to STACK because it's nice to know that you're always dealing with a string. After some awkward troubleshooting, I've just noticed thatget_ops
callsop
instead ofsafe_op
.I imagine that just swapping
op
forsafe_op
would break all sorts of unexpected things, so might I suggest that we addget_safe_ops
toassessment.mac
? My suggested code is:get_safe_ops(ex):= setify(flatten(get_safe_ops_helper(ex)))$
get_safe_ops_helper(ex):=if mapatom(ex) then [] else append([safe_op(ex)],maplist(get_safe_ops_helper,args(ex)))$