From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.lisp.guile.user Subject: shunt Date: Mon, 29 May 2017 09:47:00 +0200 Message-ID: <87wp90w1e3.fsf@zigzag> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: blaine.gmane.org 1496043740 24085 195.159.176.226 (29 May 2017 07:42:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 29 May 2017 07:42:20 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon May 29 09:42:16 2017 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 1dFFJd-00066k-LU for guile-user@m.gmane.org; Mon, 29 May 2017 09:42:13 +0200 Original-Received: from localhost ([::1]:47321 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dFFJj-00065b-7c for guile-user@m.gmane.org; Mon, 29 May 2017 03:42:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44949) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dFFJM-00065V-Cl for guile-user@gnu.org; Mon, 29 May 2017 03:41:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dFFJH-0005k3-HH for guile-user@gnu.org; Mon, 29 May 2017 03:41:56 -0400 Original-Received: from mail.agora-net.com ([67.59.132.6]:46758) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dFFJH-0005jM-C5 for guile-user@gnu.org; Mon, 29 May 2017 03:41:51 -0400 Original-Received: from ttn by mail.agora-net.com with local (Exim 4.82) (envelope-from ) id 1dFFJE-0005Oz-OR for guile-user@gnu.org; Mon, 29 May 2017 03:41:48 -0400 Original-Received: from ttn by zigzag.favinet with local (Exim 4.80) (envelope-from ) id 1dFFOS-0007YC-Vc for guile-user@gnu.org; Mon, 29 May 2017 09:47:13 +0200 X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: ttn@gnuvola.org X-SA-Exim-Scanned: No (on mail.agora-net.com); SAEximRunCond expanded to false X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 67.59.132.6 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:13752 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable In SGF Utils[0], i use =E2=80=98shunt=E2=80=99: (define-macro (shunt proc-names . otherwise) `(lambda (command . args) (apply (case command ,@(map (lambda (name) `((,name) ,name)) proc-names) (else ,(if (null? otherwise) '(error "bad command:" command) `(lambda args ,(car otherwise))))) args))) to delegate commands to a closure's set of internal procedures. Is something similar already included w/ Guile? ___________________________ [0] http://www.gnuvola.org/software/sgf-utils/ $ cd .../sgf-utils/src && grep -nHF -e shunt *.scm base.scm:27: #:export (catch-one FE shunt fs fop<-)) base.scm:41:(define-macro (shunt proc-names . otherwise) base.scm:42: ;; (put 'shunt 'scheme-indent-function 1) gnugo.scm:54: ((base) #:select (shunt fs)) gnugo.scm:173: (shunt (set-board-size! render.scm:27: ((base) #:select (FE fs shunt)) render.scm:106: (shunt (h1) render.scm:209: (shunt (try)))) render.scm:910: (define I (shunt (clear! sgfv.scm:85: ((base) #:select (FE shunt fs fop<-)) sgfv.scm:312: (shunt (at forw! back! vary! =2D-=20 Thien-Thi Nguyen ----------------------------------------------- (defun responsep (query) (pcase (context query) (`(technical ,ml) (correctp ml)) ...)) 748E A0E8 1CB8 A748 9BFA =2D-------------------------------------- 6CE4 6703 2224 4C80 7502 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlkr0fgACgkQZwMiJEyAdQIyJgCg1S7QZdP1zcEpBlZTNTSmpmPq j0QAnRCkvORhJzKWdAu+/O1zSPWhDIMw =Yo+S -----END PGP SIGNATURE----- --=-=-=--