Also, testing on PIKE_T_FUNCTION might not be such a good idea, since then using an object with a `() operator won't work, neither will using a program as a callback. The builtin callablep() recognizes PIKE_T_FUNCTION, PIKE_T_PROGRAM, PIKE_T_OBJECT, and PIKE_T_ARRAY, but a better approach might be to just try apply_svalue if the svalue is nonzero and not a string (the case you want to handle differently).
Re: callback support for encoding JSON
Marcus Comstedt (ACROSS) (Hail Ilpalazzo!) @ Pike (-) developers forum Wed, 22 May 2013 02:26:19 -0700
