unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Thien-Thi Nguyen <ttn@giblet.glug.org>
Cc: guile-user@gnu.org
Subject: Re: [guile/scwm] SCM_HOOKP changed?
Date: Sun, 15 Sep 2002 14:28:16 -0700	[thread overview]
Message-ID: <E17qgwC-00081x-00@giblet> (raw)
In-Reply-To: <E17qgRq-0007xW-00@giblet> (message from Thien-Thi Nguyen on Sun, 15 Sep 2002 13:56:54 -0700)

   From: Thien-Thi Nguyen <ttn@giblet.glug.org>
   Date: Sun, 15 Sep 2002 13:56:54 -0700

   they should be removed
   to emphasize the two different systems.

actually removal just obfuscates.  this is better:

   2002-09-15  Thien-Thi Nguyen  <ttn@dream.glug.org>

	* scheme-utility.twerp (Hook Reference): Mention and pxref C-level hooks.
	(C Hooks): Add subsection "Handling Scheme-level hooks from C code".

see below for diff.

thi


______________________________________________
Index: scheme-utility.twerp
===================================================================
RCS file: /home/ttn/cvs/guile-core/doc/ref/scheme-utility.twerp,v
retrieving revision 1.4
diff -w -c -b -c -p -r1.4 scheme-utility.twerp
*** scheme-utility.twerp	29 Aug 2002 05:34:05 -0000	1.4
--- scheme-utility.twerp	15 Sep 2002 21:21:56 -0000
*************** The ordering of the list of procedures r
*** 402,407 ****
--- 402,411 ----
  matches the order in which those procedures would be called if the hook
  was run using @code{run-hook}.
  
+ Note that the following C functions are for handling
+ @dfn{Scheme-level} hooks in C; there are also @dfn{C-level} hooks
+ which have their own interface (@pxref{C Hooks}).
+ 
  @twerpdoc (make-hook (C scm_make_hook))
  
  @twerpdoc (hook? (C scm_hook_p))
*************** function's closure data, and the call cl
*** 529,534 ****
--- 533,556 ----
  
  @code{scm_c_hook_run}'s return value is the return value of the last
  function to be called.
+ @end deftypefn
+ 
+ @subsection Handling Scheme-level hooks from C code
+ 
+ To handle Scheme-level hooks from C code you must use the appropriate
+ C functions (@pxref{Hook Reference}).  For example:
+ 
+ @example
+ if (SCM_HOOKP (obj))
+   /* handle C-level hook */
+ else if (scm_hook_p (obj))
+   /* handle Scheme-level hook using C functions */
+ else
+   /* do something else (obj is not a hook) */
+ @end example
+ 
+ @deftypefn {C Macro} int SCM_HOOKP (x)
+ Return 1 if @var{x} is a C-level hook and 0 otherwise.
  @end deftypefn
  
  


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user


  reply	other threads:[~2002-09-15 21:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-15 13:01 [guile/scwm] SCM_HOOKP changed? P Pareit
2002-09-15 20:56 ` Thien-Thi Nguyen
2002-09-15 21:28   ` Thien-Thi Nguyen [this message]
2002-09-16  4:39     ` Thien-Thi Nguyen
2002-09-16  9:50     ` Marius Vollmer
2002-09-16 11:35       ` Thien-Thi Nguyen
2002-09-19 20:20         ` Neil Jerram
2002-09-15 23:59 ` Marius Vollmer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E17qgwC-00081x-00@giblet \
    --to=ttn@giblet.glug.org \
    --cc=guile-user@gnu.org \
    --cc=ttn@glug.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).