From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Christopher Howard Newsgroups: gmane.lisp.guile.user Subject: Re: Signals / Messages / Events / ...? Date: Wed, 03 Jan 2018 06:11:20 -0900 Message-ID: <1514992280.4049.5.camel@qlfiles.net> References: <1514956159.4049.2.camel@qlfiles.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-5OgyFyNXVfouceARgdt9" X-Trace: blaine.gmane.org 1514992263 14339 195.159.176.226 (3 Jan 2018 15:11:03 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 3 Jan 2018 15:11:03 +0000 (UTC) To: Neil Jerram , guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Wed Jan 03 16:10:59 2018 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eWkgs-0002sA-BO for guile-user@m.gmane.org; Wed, 03 Jan 2018 16:10:50 +0100 Original-Received: from localhost ([::1]:55219 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eWkir-0004dC-Lg for guile-user@m.gmane.org; Wed, 03 Jan 2018 10:12:53 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58636) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eWkhX-0003uL-MT for guile-user@gnu.org; Wed, 03 Jan 2018 10:11:33 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eWkhT-0006Y8-Fx for guile-user@gnu.org; Wed, 03 Jan 2018 10:11:31 -0500 Original-Received: from mx.kolabnow.com ([95.128.36.40]:64768) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eWkhT-0006U0-5S for guile-user@gnu.org; Wed, 03 Jan 2018 10:11:27 -0500 Original-Received: from localhost (unknown [127.0.0.1]) by ext-mx-out001.mykolab.com (Postfix) with ESMTP id 99055205; Wed, 3 Jan 2018 16:11:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= mime-version:content-type:content-type:references:in-reply-to :date:date:from:from:subject:subject:message-id:received :received:received; s=dkim20160331; t=1514992285; x=1514992307; bh=XeOBZaxm92NqKQPVRxU5K4w0LgutDbmy5PPz4BxCYVk=; b=SngBye6JK5fX dV3JQmiu89pyRnfpcER5pEFtBOlsBMO73jR6BK8YGlwdeMPXBgecYPKqlN7ld5cC zCKogdM5W4ZJ6BvesGYVyRUTQjkVnPn8kH/pxgKHy9VsYWWOAYTYLHNOXcbn6tH1 JqNY2/4gJWgggQLtLy3C7kUGg9oMMUPFpQMDMJmEn0TXkahgBjDfZ/X8hYoanU05 R/+cQ5knCtJ67xrWNwfXQzpffK2sRTYZS0r3eOKWR+MqKQSqYuv9rSlBx/cKumjo RzELcJbwszUdX/Te4KCeDJi35N4dBviLYX2CKtKqmWwXwm/k/zorHKcGDDiO8/ap t6nWqDO8kYknr+40emnxveVSnt30O3niWjYGI6SsVdRrd0HV39zhRJfuCgjY9kNG A8IBsa/sZB01ZRYsoej84/Q0LZFy0/2KfPnzOc5lIjMEG5BHIz1HGrmCRr1QeONn +i8i5PvN2pk0s/VS0Y1iH12HDxBrTGXFECBMlUFy/3UoqjWzHhYVgkWOIMQI9d5w WimcpfZBL/0Kj4lZWJbXlxpSYYv+ZiBkp2zks0iuvzhWLLf X-Virus-Scanned: amavisd-new at mykolab.com Original-Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out001.mykolab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1iH4FcOYjgR4; Wed, 3 Jan 2018 16:11:25 +0100 (CET) Original-Received: from int-mx001.mykolab.com (unknown [10.9.13.1]) by ext-mx-out001.mykolab.com (Postfix) with ESMTPS id 3946A15B; Wed, 3 Jan 2018 16:11:25 +0100 (CET) Original-Received: from ext-subm002.mykolab.com (unknown [10.9.6.2]) by int-mx001.mykolab.com (Postfix) with ESMTPS id 1001415C; Wed, 3 Jan 2018 16:11:25 +0100 (CET) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 95.128.36.40 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:14401 Archived-At: --=-5OgyFyNXVfouceARgdt9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2018-01-03 at 11:53 +0000, Neil Jerram wrote: >=20 > Well, one Lispy mechanism in that area is hooks.=C2=A0 For example, from > some=C2=A0 > of my old code: >=20 > ;; Changes to modem registration state are indicated by calling this > ;; hook with args STATE and PROPERTIES.=C2=A0 STATE can be 'none, meaning > ;; that there is currently no modem; 'unregistered, meaning that > there > ;; is a modem but it isn't registered with the network; or > ;; 'registered, meaning that the modem is registered with the > network. > ;; If STATE is 'registered, PROPERTIES is an alist of registration > ;; properties; otherwise PROPERTIES is #f. > (define registration-hook (make-hook 2)) >=20 > (define (add-registration-hook proc) > =C2=A0=C2=A0 (add-hook! registration-hook proc)) >=20 > (define (notify-registration state properties) > =C2=A0=C2=A0 (run-hook registration-hook state properties)) >=20 > Does that serve your purpose at all? >=20 > Best wishes - Neil >=20 >=20 I think that should work. Only part I'm not sure about is if you can have a "one-off" procedure added to a hook... but you could just have the procedure call remove-hook! to remove itself...? --=20 https://www.debian.org/ --=-5OgyFyNXVfouceARgdt9 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEE3cRyrLOhI3rPcNVUee7NbCP9XMUFAlpM8pgACgkQee7NbCP9 XMU+OQf/V4V/8UTfUeqIEkKCXgnwiKZX3Cp/sUBSFhLaK9Df5wh/5oNf67f7xnOh PONQz8jnt5SXXqGZVsKjLIMvc28oxzBgiTUebnht3VQAreONbn45PFgPv7w/MnUG HYNoFKZcVurRV6x2fNp4uXjRTBrNXb/w5zd4+4bDvA5NJaZgjj0PKplaYF1UOWWL SS9J76v73V+q/GnV5/pDXJ7cgL0TFl5xB9Jn7NsEHeIMAyebl9Dy7wmZIvj9h5sf WBoSlDNXkZ67F8KFbEiw7pu4d8WwKDxf2fBCnMuKBDsdFPSdSf7DRDZeDyKhTOFy XE11Hl4FDCUDi071rtS8a6ECgpO8Sw== =vMPb -----END PGP SIGNATURE----- --=-5OgyFyNXVfouceARgdt9--