patch 7.4.1559
Problem:    Passing cookie to a callback is clumsy.
Solution:   Change function() to take arguments and return a partial.
diff --git a/src/json.c b/src/json.c
index 34cf188..cd80a76 100644
--- a/src/json.c
+++ b/src/json.c
@@ -212,6 +212,7 @@
 	    break;
 
 	case VAR_FUNC:
+	case VAR_PARTIAL:
 	case VAR_JOB:
 	case VAR_CHANNEL:
 	    /* no JSON equivalent TODO: better error */