Added time macro

This commit is contained in:
Abdulaziz Ghuloum 2007-08-30 11:06:21 -04:00
parent 2d9f5377ae
commit 28b143036f
5 changed files with 17 additions and 11 deletions

View File

@ -230,7 +230,6 @@ gc_tconc_push_extending(gc_t* gc, ikp tcbucket){
p->next = gc->tconc_queue; p->next = gc->tconc_queue;
gc->tconc_queue = p; gc->tconc_queue = p;
} }
/* Wrong MR! */
ikp ap = ikp ap =
ik_mmap_typed(pagesize, ik_mmap_typed(pagesize,
meta_mt[meta_ptrs] | next_gen_tag[0], meta_mt[meta_ptrs] | next_gen_tag[0],
@ -1070,7 +1069,7 @@ add_object_proc(gc_t* gc, ikp x)
if((! is_fixnum(key)) && (tagof(key) != immediate_tag)){ if((! is_fixnum(key)) && (tagof(key) != immediate_tag)){
unsigned int kt = gc->segment_vector[page_index(key)]; unsigned int kt = gc->segment_vector[page_index(key)];
if((kt & gen_mask) <= gc->collect_gen){ if((kt & gen_mask) <= gc->collect_gen){
/* key is moved */ /* key will be moved */
gc_tconc_push(gc, y); gc_tconc_push(gc, y);
} }
} }
@ -1777,8 +1776,7 @@ add_one_tconc(ikpcb* pcb, ikp p){
assert(tagof(tc) == pair_tag); assert(tagof(tc) == pair_tag);
ikp d = ref(tc, off_cdr); ikp d = ref(tc, off_cdr);
assert(tagof(d) == pair_tag); assert(tagof(d) == pair_tag);
/* Wrong MR! */ ikp new_pair = p + pair_tag;
ikp new_pair = p + pair_tag; //ik_alloc(pcb, pair_size) + pair_tag;
ref(d, off_car) = tcbucket; ref(d, off_car) = tcbucket;
ref(d, off_cdr) = new_pair; ref(d, off_cdr) = new_pair;
ref(new_pair, off_car) = false_object; ref(new_pair, off_car) = false_object;

Binary file not shown.

View File

@ -784,6 +784,11 @@
(bless `(letrec ([,f (lambda ,lhs* ,b . ,b*)]) (bless `(letrec ([,f (lambda ,lhs* ,b . ,b*)])
(,f . ,rhs*))) (,f . ,rhs*)))
(stx-error stx "invalid syntax"))]))) (stx-error stx "invalid syntax"))])))
(define time-macro
(lambda (stx)
(syntax-match stx ()
[(_ expr)
(bless `(time-it ',expr (lambda () ,expr)))])))
(define identifier-syntax-macro (define identifier-syntax-macro
(lambda (stx) (lambda (stx)
(syntax-match stx () (syntax-match stx ()
@ -1567,6 +1572,7 @@
[(quasiquote) quasiquote-macro] [(quasiquote) quasiquote-macro]
[(with-syntax) with-syntax-macro] [(with-syntax) with-syntax-macro]
[(identifier-syntax) identifier-syntax-macro] [(identifier-syntax) identifier-syntax-macro]
[(time) time-macro]
[(... => _ else) incorrect-usage-macro] [(... => _ else) incorrect-usage-macro]
[else (error 'macro-transformer "invalid macro ~s" x)])] [else (error 'macro-transformer "invalid macro ~s" x)])]
[else (error 'core-macro-transformer "invalid macro ~s" x)]))) [else (error 'core-macro-transformer "invalid macro ~s" x)])))

View File

@ -109,6 +109,7 @@
[do (macro . do)] [do (macro . do)]
[and (macro . and)] [and (macro . and)]
[or (macro . or)] [or (macro . or)]
[time (macro . time)]
[... (macro . ...)] [... (macro . ...)]
[=> (macro . =>)] [=> (macro . =>)]
[else (macro . else)] [else (macro . else)]
@ -234,6 +235,7 @@
[do i r] [do i r]
[and i r] [and i r]
[or i r] [or i r]
[time i]
[... i r] [... i r]
[=> i r] [=> i r]
[else i r] [else i r]

View File

@ -527,15 +527,15 @@
[command-line C pr] [command-line C pr]
[exit C pr] [exit C pr]
[delay D r5] [delay S r5]
[exact->inexact C r5] [exact->inexact C r5]
[force D r5] [force S r5]
[inexact->exact C r5] [inexact->exact C r5]
[modulo D r5] [modulo C r5]
[remainder D r5] [remainder C r5]
[null-environment D r5] [null-environment S r5]
[quotient D r5] [quotient C r5]
[scheme-report-environment D r5] [scheme-report-environment S r5]
[close-port D ip] [close-port D ip]
[eol-style D ip] [eol-style D ip]