2009 March 27th Friday (三月 二十七日 金曜日)

   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 <----+

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值