[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
shunt
From: |
Thien-Thi Nguyen |
Subject: |
shunt |
Date: |
Mon, 29 May 2017 09:47:00 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) |
In SGF Utils[0], i use ‘shunt’:
(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!
--
Thien-Thi Nguyen -----------------------------------------------
(defun responsep (query)
(pcase (context query)
(`(technical ,ml) (correctp ml))
...)) 748E A0E8 1CB8 A748 9BFA
--------------------------------------- 6CE4 6703 2224 4C80 7502
signature.asc
Description: PGP signature
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- shunt,
Thien-Thi Nguyen <=