~ chicken-core (chicken-5) ac9833e69238e3c8637b63865ccd042e39936201
commit ac9833e69238e3c8637b63865ccd042e39936201
Author: felix <felix@call-with-current-continuation.org>
AuthorDate: Wed Mar 9 04:25:40 2011 -0500
Commit: felix <felix@call-with-current-continuation.org>
CommitDate: Wed Mar 9 04:25:40 2011 -0500
rewrites for alist-cons and xcons
diff --git a/c-platform.scm b/c-platform.scm
index 1a3e9273..a65c386a 100644
--- a/c-platform.scm
+++ b/c-platform.scm
@@ -127,7 +127,7 @@
list-ref abs char-ready? peek-char list->string string->list) )
(define default-extended-bindings
- '(bitwise-and
+ '(bitwise-and alist-cons xcons
bitwise-ior bitwise-xor bitwise-not add1 sub1 fx+ fx- fx* fx/
fx+? fx-? fx*? fx/? fxmod o
fx= fx> fx< fx>= fx<= fixnum? fxneg fxmax fxmin identity fp+ fp- fp* fp/ fpmin fpmax fpneg
@@ -1160,3 +1160,31 @@
(rewrite 'get-keyword 7 2 "C_i_get_keyword" #f #t)
(rewrite '##sys#get-keyword 7 2 "C_i_get_keyword" #f #t)
+
+(rewrite
+ 'alist-cons 8
+ (lambda (db classargs cont callargs)
+ (and (= 3 (length callargs))
+ (make-node
+ '##core#call '(#t)
+ (list cont
+ (make-node
+ '##core#inline_allocate
+ '("C_a_i_cons" 3)
+ (list (make-node
+ '##core#inline_allocate
+ '("C_a_i_cons" 3)
+ (list (first callargs) (second callargs)))
+ (third callargs))))))))
+
+(rewrite
+ 'xcons 8
+ (lambda (db classargs cont callargs)
+ (and (= 2 (length callargs))
+ (make-node
+ '##core#call '(#t)
+ (list cont
+ (make-node
+ '##core#inline_allocate
+ '("C_a_i_cons" 3)
+ (reverse callargs)))))))
diff --git a/manual/faq b/manual/faq
index 5053951b..e747ecd2 100644
--- a/manual/faq
+++ b/manual/faq
@@ -416,6 +416,7 @@ and compiler settings:
The following extended bindings are handled specially:
+{{alist-cons}}
{{bitwise-and}} {{bitwise-ior}} {{bitwise-xor}} {{bitwise-not}}
{{bit-set?}} {{add1}} {{sub1}}
{{fx+}} {{fx-}} {{fx*}} {{fx/}}
@@ -472,6 +473,7 @@ The following extended bindings are handled specially:
{{error}} {{call/cc}} {{any?}}
{{substring=?}} {{substring-ci=?}} {{substring-index}} {{substring-index-ci}}
{{printf}} {{sprintf}} {{fprintf}} {{format}} {{o}}
+{{xcons}}
==== What's the difference betweem "block" and "local" mode?
Trap