diff --git a/NEWS b/NEWS index 3cb8fd6a1..8071f710f 100644 --- a/NEWS +++ b/NEWS @@ -52,6 +52,8 @@ reduced to 30% of what it was previously. Correctly written scripts load the modules they require at the top of the file and should not be affected by this change. +** Hooks are now represented as smobs + * Changes to Scheme functions and syntax ** Readline support has changed again. @@ -110,6 +112,12 @@ If present, FLAGS is passed as the FLAGS argument to regexp-exec. Return #t if OBJ is a hook, otherwise #f. +*** New function: make-hook-with-name NAME [ARITY] + +Return a hook with name NAME and arity ARITY. The default value for +ARITY is 0. The only effect of NAME is that it will appear when the +hook object is printed to ease debugging. + *** New function: hook-empty? HOOK Return #t if HOOK doesn't contain any procedures, otherwise #f. @@ -253,6 +261,23 @@ these compilation units has been cleaned up and better structured. New function: SCM scm_call_generic_2 (GENERIC, ARG1, ARG2) New function: SCM scm_call_generic_3 (GENERIC, ARG1, ARG2, ARG3) +** Deprecated function: scm_make_named_hook + +It is now replaced by: + +** New function: SCM scm_create_hook (const char *name, int arity) + +Creates a hook in the same way as make-hook above but also +binds a variable named NAME to it. + +This is the typical way of creating a hook from C code. + +Currently, the variable is created in the "current" module. +This might change when we get the new module system. + +[The behaviour is identical to scm_make_named_hook.] + + Changes since Guile 1.3: @@ -1367,8 +1392,8 @@ binds a variable named NAME to it. This is the typical way of creating a hook from C code. -Currently, the variable is created in the root module. This will -change when we get the new module system. +Currently, the variable is created in the "current" module. This +might change when we get the new module system. ** The smob interface diff --git a/RELEASE b/RELEASE index 21c13b888..dc4ffbcde 100644 --- a/RELEASE +++ b/RELEASE @@ -14,6 +14,7 @@ In release 1.4: - remove kw.h, scm_tc16_kw - remove genio.h - remove deprecated function scm_newsmob. +- remove deprecated function scm_make_named_hook. Modules sort.c and random.c should be factored out into separate modules (but still be distributed with guile-core) when we get a new diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 8a172e657..524bc59e4 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,10 @@ +1999-09-13 Mikael Djurfeldt + + * feature.c (scm_create_hook): New function. Replaces + scm_make_named_hook which is now deprecated. + (scm_make_hook_with_name): New primitive. + (print_hook): Hooks now print in a fancy way. + 1999-09-12 Mikael Djurfeldt * __scm.h, backtrace.c, backtrace.h, debug.c, debug.h, dynl-dld.c,