glycerine/zygomys

Hook Syntax

ejemba opened this issue · 4 comments

Can you just give a sample for the hook (Pre and Post) in the wiki ?

PS
Thank you for this amazing lib !

Thanks @ejemba :)

The hooks allow Go functions to monitor Lisp functions. For example, see CountPreHook and CountPostHook

func CountPreHook(env *Glisp, name string, args []Sexp) {

and

if cfg.CountFuncCalls {

I'll leave this open as a reminder to add a description to the wiki in the near future.

Thinking on this a little more, the hooks are mostly a means of internal profiling, left over from the Glisp days. I removed them from the feature list just now. They are still there internally, but not really meant to support anything vis-a-vis the language itself. So I'm closing this out as an (intentionally undocumented and unsupported feature); any user of the library can do similar or even simpler profiling trivially.

@glycerine thank you for your answer :) I was thinking of them like the advice in emacs-lisp
defadvice or hook that are very usefull.

Thanks anyway :)

@ejemba wow I had no idea emacs lisp had all that. It's so built out. Kind of amazing. Glad you mentioned it(!)