add compare_func
spec: compare_func
doc: compare_func
doc: example