June 7th Thursday (六月 七日 木曜日)
来源:互联网 发布:怎样把网络视频下载 编辑:程序博客网 时间:2024/04/28 08:00
How to use a fender in "syntax-case" form? I got a example today.
;; utility for defining ~foo but make it look like #<procedure:foo>
(define-syntax (define* stx)
(syntax-case stx ()
[(_ ~name val) (identifier? #'~name)
(let* ([~str (symbol->string (syntax-e #'~name))]
[str (string->symbol (regexp-replace #rx"^[~*]" ~str ""))])
(with-syntax ([name (datum->syntax-object #'~name str #'~name)])
#'(define ~name (let ([name val]) (mark-lazy name)))))]
[(_ (~name . xs) body ...) (identifier? #'~name)
#'(define* ~name (lambda xs body ...))]))
I got other examples. However, they are wrong and can not be parsed correctly.
According to the above example, I wrote another simple macro.
(define-syntax m
(lambda (x)
(syntax-case x ()
((_ ~name) (not (identifier? #'~name))
#'~name))))
- June 7th Thursday (六月 七日 木曜日)
- June 14th Thursday (六月 十四日 木曜日)
- June 21th Thursday (六月 二十一日 木曜日)
- June 28th Thursday (六月 二十八日 木曜日)
- June 4th Thursday (六月 四日 木曜日)
- June 11th Thursday (六月 十一日 木曜日)
- June 25th Thursday (六月 二十五日 木曜日)
- May 7th Thursday (五月 七日 木曜日)
- 2008 August 7th Thursday (八月 七日 木曜日)
- June 19th Friday (六月 十九日 木曜日)
- June 18th Tuesday (六月 十八日 木曜日)
- June 1th Friday (六月 一日 金曜日)
- June 6th Wednesday (六月 六日 水曜日)
- June 8th Friday (六月 八日 金曜日)
- June 12th Tuesday (六月 十二日 火曜日)
- June 13th Wednesday (六月 十三日 水曜日)
- June 19th Tuesday (六月 十九日 火曜日)
- June 20th Wednesday (六月 二十日 水曜日)
- 复制数据库时,必须要先停止Sql Server服务,才能复制.否则提示:无法复制,文件正在被另一个人或程序使用.
- June 6th Wednesday (六月 六日 水曜日)
- AJAX编写的用户注册实例及技术小结
- PPM格式转化为BMP格式的实现
- What Is a Desision?
- June 7th Thursday (六月 七日 木曜日)
- 超级电脑牛人
- IBM容灾白皮书
- June 8th Friday (六月 八日 金曜日)
- 隐藏计算机中的网卡
- 《Intel架构软件开发指南》翻译进行中。。。
- June 11th Monday (六月 十一日 月曜日)
- Solaris10网卡的设置
- 解决mysql和jsp交互的乱码问题