Today my main task is to study some source on the old project EV. From those sources, we have to build a new management program on public
line. The new program will need less men to manage or monitor a group of building. Under the circumstance of economic crisis, it will be
a good tool in order to cut down staff, especially, building manager or monitor.
However, I found that some strange logic is here and there. It is not easy to comprehend them.
#`(1)
(define-syntax n
(lambda (x)
(syntax-case x ()
((_ #(p1 p2 pe ... p4 p5))
(syntax (list
(list p1 p2)
(list pe ...)
(list p4 p5)))))))
> (n #(1 2 3 4 5 6 7 8))
((1 2) (3 4 5 6) (7 8))
(define-syntax m
(lambda (x)
(syntax-case x ()
((_ p1 p2 pe ... p4 p5 . pt)
(syntax (list
(list p1 p2)
(list pe ...)
(list p4 p5)
(list pt)))))))
> (m 1 2 3 4 5 6 7 . 8)
((1 2) (3 4 5) (6 7) (8))
(define-syntax v
(lambda (x)
(syntax-case x ()
((_ p1 p2 . pt)
(syntax (list
(list p1 p2)
(list pt)))))))
> (v 1 2 . 3)
((1 2) (3))
Every predicate has a alike following control flow.
+-----------+
call -->| |--> exit
| predicate |
fail <--| |<-- redo
+-----------+
|
exception <----+
repeat:
+-----------+
call -->| +->|--> exit
| repeat | |
fail <--| +--|<-- redo
+-----------+
|
exception <----+
fail:
+-----------+
call -->|--+ |--> exit
| | fail |
fail <--|<-+ |<-- redo
+-----------+
|
exception <----+
2009 March 27th Friday (三月 二十七日 金曜日)
最新推荐文章于 2025-08-22 13:08:41 发布